How to extract only "2009/01/04/b3justin04cmmv","2009/01/11/ymtestdrive11bnk","2009/01/13/a2correx13".Code:<?php $file = array('2009/01/04/b3justin04cmmv,.nzsfoiwauf','2009/01/11/ymtestdrive11bnk,hhukt7yufgv','2009/01/13/a2correx13, bvj,hgho'); foreach($file as $f){ print "The input is : $f"; preg_match("/(\d{4}\/\d{2}\/\d{2}\/[^ ]*)/","$f",$match); print "The output is : $match[0]\n"; }
How to remove "," comma at the end. and find the last string before ","




Bookmarks