Re: Re: preg_replace
| From: | Gerard Samuel | Date: | Mon, 17 Jun 2002 05:53:35 +0000 |
| Subject: | Re: Re: preg_replace | ||
| References: | 1 2 3 4 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-102468@lists.php.net to get a copy of this message | ||
Thanks for the slap upside my head.
:)
Analysis & Solutions wrote:
On Sun, Jun 16, 2002 at 09:04:08PM -0400, Gerard Samuel wrote:-- Gerard Samuel http://www.trini0.org:81/ http://dev.trini0.org:81/I still needed to drop the '=' chars, so here is the modified version Thanks for your help preg_replace('/(=)([A-Z0-9_]+)(=)/e', 'constant("$2")', $foo);Gerard, you're more stubborn than _I_ am! :) As CC pointed out, you're not putting the ='s in the replace, so there's no need to waste resourcs by atomizing them. Take them out of the parentheses and switch $2 to $1. See you, --Dan