fork download
  1. <?php
  2.  
  3. $myfile = 'a,2014-10-05 19:00:40,
  4.  
  5. b,2014-10-05 19:00:31,';
  6.  
  7. $name = 'a';
  8.  
  9. if(preg_match("/$name\,(.*),/", $myfile, $matches))
  10. {
  11. //$results = preg_replace("/$name.*\,/", $txt, $myfile);
  12. }
  13.  
  14. echo $matches[1];
Success #stdin #stdout 0.01s 20520KB
stdin
Standard input is empty
stdout
2014-10-05 19:00:40