fork(4) download
  1. <?php
  2.  
  3. $str= 'We have new Call Request: Reference = 55823014, Name = Amal, Mobile = 111111';
  4.  
  5. preg_match('/Reference =(.*?), Name =(.*?), Mobile =(.*)/', $str, $m);
  6.  
  7. print_r($m);
  8.  
  9. //if you want to display an item at a time
  10.  
  11. echo "Reference = ".$m[1].PHP_EOL;
  12. echo "Name = ".$m[2].PHP_EOL;
  13. echo "Mobile = ".$m[3].PHP_EOL;
  14.  
Success #stdin #stdout 0.02s 52432KB
stdin
Standard input is empty
stdout
Array
(
    [0] => Reference = 55823014, Name = Amal, Mobile = 111111
    [1] =>  55823014
    [2] =>  Amal
    [3] =>  111111
)
Reference =  55823014
Name =  Amal
Mobile =  111111