fork download
  1. <?php
  2.  
  3. $message="#porrabarça per avui @RTorq el @FCBar guanyarà per 3-1 al AC Milan";
  4.  
  5. preg_match("/\d+-\d+/", $message, $match);
  6. $num = $match[0];
  7.  
  8. var_dump($num);
Success #stdin #stdout 0.02s 13064KB
stdin
Standard input is empty
stdout
string(3) "3-1"