fork download
  1. <?php
  2. $rexp='/<userinfo>.*?(\d+).*?<\/userinfo>/i';
  3. $result=array();
  4. echo 'start';
  5. echo preg_match_all($rexp, '<userinfo>Jsome text here 16586 more text here.</userinfo>', $result);
  6.  
  7. var_dump($result);
  8. ?>
Success #stdin #stdout 0.02s 13112KB
stdin
Standard input is empty
stdout
start1array(2) {
  [0]=>
  array(1) {
    [0]=>
    string(58) "<userinfo>Jsome text here 16586 more text here.</userinfo>"
  }
  [1]=>
  array(1) {
    [0]=>
    string(5) "16586"
  }
}