Jump to content

Match the string


sandy1028

Recommended Posts

<?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 extract only "2009/01/04/b3justin04cmmv","2009/01/11/ymtestdrive11bnk","2009/01/13/a2correx13".

 

How to remove "," comma at the end. and find the last string before ","

 

Link to comment
https://forums.phpfreaks.com/topic/177321-match-the-string/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.