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 =
Zac:
$cntnt = eregi_replace(\[L=([a-zA-Z]+)].([a-zA-Z]+)\[EL],
a href=\ . fndLnk(\\1) . \\\2/a, $cntnt);
Put \\1 in double quotes so it gets evaluated as a substring.
a href=\ . fndLnk(\\1) . \\\2/a, $cntnt);
Enjoy,
--Dan
--
PHP classes that make web design easier
2 matches
Mail list logo