Re: Problem with a regex!

From: Date: Sun, 28 Jan 2001 02:11:49 +0000
Subject: Re: Problem with a regex!
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-37074@lists.php.net to get a copy of this message
In article <20010128011709.78C253ECC@sitemail.everyone.net>, hamoe@sect0r.com (Zack Ham) wrote: > What I'm trying to do is run through it and replace {title} with an > appropriate value. I have tried running > ereg_replace("{$var}",$value,$string) and > ereg_replace("\{$var\}",$value,$string). Neither work. They either do > nothing or produce the error "Warning: invalid content of \{\}". Is $var=="title" (same case, no leading/trailing whitespace, etc.)? If so, then perhaps try: ereg_replace("\{" . $title . "\}",$value,$string) If not, then perhaps one of these: eregi_replace("\{" . $title . "\}",$value,$string) eregi_replace("\{title\}",$value,$string) -- CC

« previous php.general (#37074) next »