fork(1) download
  1. <?php
  2.  
  3. function retFirstDigitChunk($input) {
  4. if (preg_match('~\(([0-9]+)~', $input, $m)) {
  5. return $m[1];
  6. } else {
  7. return "";
  8. }
  9. }
  10.  
  11. $tuple = "(12342,43244)";
  12. echo retFirstDigitChunk($tuple);
Success #stdin #stdout 0.03s 52480KB
stdin
Standard input is empty
stdout
12342