RE: [PHP] Regular Expression

From: Date: Mon, 24 Jul 2000 07:34:47 +0000
Subject: RE: [PHP] Regular Expression
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-7770@lists.php.net to get a copy of this message
If $XXX is a real variable name... ${$XXX} will evaluate it as a variable whose name is stored in the variable $XXX -----Original Message----- From: Mathieu Arnold [mailto:arn_mat@club-internet.fr] Sent: Sunday, July 23, 2000 3:06 AM To: php-general@lists.php.net Subject: Re: [PHP] Regular Expression 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 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net For additional commands, e-mail: php-general-help@lists.php.net To contact the list administrators, e-mail: php-list-admin@lists.php.net

« previous php.general (#7770) next »