Re: Re: preg_replace

From: Date: Mon, 17 Jun 2002 05:03:22 +0000
Subject: Re: Re: preg_replace
References: 1 2 3  Groups: php.general 
Request: Send a blank email to php-general+get-102467@lists.php.net to get a copy of this message
On Sun, Jun 16, 2002 at 09:04:08PM -0400, Gerard Samuel wrote: > 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 -- PHP classes that make web design easier SQL Solution | Layout Solution | Form Solution sqlsolution.info | layoutsolution.info | formsolution.info T H E A N A L Y S I S A N D S O L U T I O N S C O M P A N Y 4015 7 Av #4AJ, Brooklyn NY v: 718-854-0335 f: 718-854-0409

« previous php.general (#102467) next »