fork download
  1. <?php
  2.  
  3. $string = "200#5;300#10";
  4. preg_match_all('/(\d+)#(\d+)/', $string, $matches);
  5. var_dump($matches);
Success #stdin #stdout 0.01s 20520KB
stdin
Standard input is empty
stdout
array(3) {
  [0]=>
  array(2) {
    [0]=>
    string(5) "200#5"
    [1]=>
    string(6) "300#10"
  }
  [1]=>
  array(2) {
    [0]=>
    string(3) "200"
    [1]=>
    string(3) "300"
  }
  [2]=>
  array(2) {
    [0]=>
    string(1) "5"
    [1]=>
    string(2) "10"
  }
}