fork download
  1. <?php
  2.  
  3. $re = "/\\d+,\\d+/";
  4. $str = "1,2,3,4,5,6,7,8";
  5. preg_match_all($re, $str, $matches);
  6. print_r($matches);
Success #stdin #stdout 0.02s 52432KB
stdin
Standard input is empty
stdout
Array
(
    [0] => Array
        (
            [0] => 1,2
            [1] => 3,4
            [2] => 5,6
            [3] => 7,8
        )

)