function within regular expression
Posted: Mon Jul 31, 2006 7:27 am
Hello ik have a regular expression to replace all urls
this is
but i want to do an encoding somthing like this
but the problem is that if the $1 is outside the quote's the parser tels me that $1 does not exist can someone point me in the right direction
greetings Bert
this is
Code: Select all
$elm1= preg_replace('/<a href="(.*?)">(.*?)<\\/a>/i', '<a href="linkto.php?param3=$1[urlklik]">$2</a><br>', $elm1);Code: Select all
$elm1= preg_replace('/<a href="(.*?)">(.*?)<\\/a>/i', '<a href="linkto.php?param3='.(base64_encode(serialize($1))).'[urlklik]">$2</a><br>', $elm1);greetings Bert