hoder.org

July 26, 2008

preg_replace

Filed under: Uncategorized — admin @ 11:07 pm

RewriteCond %{REQUEST_FILENAME} /(.*)-f([0-9]*).html

<?php
$patterns 
= array (‘/(19|20)(\d{2})-(\d{1,2})-(\d{1,2})/’
,
                   
‘/^\s*{(\w+)}\s*=/’
);
$replace = array (‘\3/\4/\1\2′‘$\1 =’
);
echo 
preg_replace($patterns$replace‘{startDate} = 1999-5-27′
);
?>

No Comments »

No comments yet.

RSS feed for comments on this post. TrackBack URL

Leave a comment

You must be logged in to post a comment.

Powered by hoder.org