Regular Expression
| From: | Tim | Date: | Sun, 23 Jul 2000 06:50:02 +0000 |
| Subject: | Regular Expression | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-7757@lists.php.net to get a copy of this message | ||
In perl, I write the following function
s/<\%=([^\>]+)\%>/$($1)/g
to replace all <%=XXX%> to $XXX
I php, I write the following function
ereg_replace("<\%=([^\>]+)\%>","$\\1",$string);
to do the same function.
but I don't know why when i print it out, perl can display the content
of $XXX but
php can only display string "$XXX"
I want to ask if there is any method to do the function like perl???