Re: [PHP4BETA] preg_replace Q
| From: | Andrei Zmievski | Date: | Thu, 20 Apr 2000 14:02:49 +0000 |
| Subject: | Re: [PHP4BETA] preg_replace Q | ||
| References: | 1 | Groups: | php.version4 |
| Request: | Send a blank email to php-version4+get-13786@lists.php.net to get a copy of this message | ||
On Thu, 20 Apr 2000, Cynic wrote:
> $output = preg_replace( "/\$(\w+)/" , "/\$GLOBALS['\\1']/" ,
> $output ) ;
>
> I need to replace $var with $GLOBALS['var'], however the regexp above
> doesn't work. What am I doing wrong?
$output = preg_replace( "/\$(\w+)/e" , "\$GLOBALS['\\1']" , $output )
;
-Andrei
* George Orwell was an optimist. *