PHP Preg_Replace: Replace Date – String Function

 
    <?
$t = "25/12/99, 14/5/00";
$t = preg_replace( "|\b(\d+)/(\d+)/(\d+)\b|", "\\2/\\1/\\3", $t );print "$t<br />";?>

Enjoyed this post? Share it!

 

Leave a comment

Your email address will not be published.