Re: Regular Expression
| From: | Mathieu Arnold | Date: | Sun, 23 Jul 2000 07:05:49 +0000 |
| Subject: | Re: Regular Expression | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-7758@lists.php.net to get a copy of this message | ||
Tim wrote:
>
> 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???
eval ?
http://php.net/manual/function.eval.php
--
Mathieu Arnold