RE: [PHP] preg_replace update
| From: | John W. Holmes | Date: | Fri, 11 Apr 2003 01:34:15 +0000 |
| Subject: | RE: [PHP] preg_replace update | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-143423@lists.php.net to get a copy of this message | ||
> ok guys sorry i've prob asked this question too many times, i'm trying
to
> replace the eregi_replace with preg_replace but my syntax is wrong
>
> $replaced_content =
> preg_replace("/\[f$key\f\]/i",$value,$replaced_content);
>
> this doesnt seem to work where
> this does
>
> $replaced = eregi_replace("\[f$key\f\]","$value",$replaced);
Try "/\[f".$key."f\]/i" for your pattern.
---John W. Holmes...
PHP Architect - A monthly magazine for PHP Professionals. Get your copy
today. http://www.phparch.com/