fork(1) download
  1. <?php
  2.  
  3. $re = '/(phone|age)=(\d+)/';
  4. $str = '/customers?phone=000000000&age=00
  5.  
  6. ';
  7.  
  8. preg_match_all($re, $str, $matches);
  9.  
  10. // Print the entire match result
  11. print_r(array_combine($matches[1], $matches[2]));
Success #stdin #stdout 0.01s 82944KB
stdin
Standard input is empty
stdout
Array
(
    [phone] => 000000000
    [age] => 00
)