ereg_replace problems
| From: | Zac Hillier | Date: | Wed, 22 May 2002 14:52:39 +0000 |
| Subject: | ereg_replace problems | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-98744@lists.php.net to get a copy of this message | ||
I'm trying to replace values within a string with a value looked up from a database. I have a
function that looks up the value in the database for me but I'm having trouble passing the
value to the function because of the backslashes, is there a way around this?
Code:
$cntnt = eregi_replace("\[L=([a-zA-Z]+)]"."([a-zA-Z]+)\[EL]", "<a
href=\"" . fndLnk(\\1) . "\">\\2</a>", $cntnt);
fndLnk is the function and the error I receive is -
Warning: Unexpected character in input: '\' (ASCII=92) state=1
Thanks for any help
Zac