RE: [PHP] preg_replace question,
| From: | John W. Holmes | Date: | Fri, 14 Mar 2003 04:48:40 +0000 |
| Subject: | RE: [PHP] preg_replace question, | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-139664@lists.php.net to get a copy of this message | ||
> yes another one sorry, i'm trying to find the most efficient way to do
a
> replactment over this
> eregi_replace("\[f$key\f\]","$value",format_content($content));, would
> preg_replace be quicker and how could i go about it ?
>
> i'd need to replace [f1247f] with its replacement value better still
maybe
> even [1313431] is needed ? i dont know why they has f's in there ?
What exactly are you trying to match and replace? Anything between [ and
]? Is 'f' the only letter that might appear? Is there a limit on the
amount of numbers that'll be between [ and ]? Are you replacing all
matches with the same $value?
---John W. Holmes...
PHP Architect - A monthly magazine for PHP Professionals. Get your copy
today. http://www.phparch.com/