title: How to find a string separated by ',' in PHP
body: <p>I have 2 types of string 
  the first </p>
  
  <pre><code>"/css/style.min.css HTTP/1.1" 200 7832 index.php?firstId=5&amp;secondid=4,6,8 HTTP/1.1"
  </code></pre>
  
  <p>the second type </p>
  
  <pre><code>"/css/style.min.css HTTP/1.1" 200 7832 /index.php?firstId=123&amp;secondid=4,6,8" "Mozilla/5.0
  </code></pre>
  
  <p><strong>i want to extract</strong> <code>4,6,8</code> with one code who works for all the case </p>
  
  <p>i tried </p>
  
  <pre><code>$line = '/index.php?firstId=123&amp;secondid=4,6,8" "Mozilla/5.0';
  $nbpers = findme($line, 'secondid=', '"') ;
  
  function findme($string, $start, $end){
      $string = ' ' . $string;
      $ini = strpos($string, $start);
      if ($ini == 0) return '';
      $ini += strlen($start);
      $len = strpos($string, $end, $ini) - $ini;
      return substr($string, $ini, $len);
  }
  </code></pre>
  
  <p>but it works just for the first case </p>
  
  <p>i tried also this regex <code>/.*?(\d+)$/</code> for finding the string who ends with numbers and i tested it in this site,  but <code>HTTP/1.1</code> ends with numbers so it was not a good idea</p>