Hi folks,
In a nutshell, I am doing this:
$findIt = array("firstHit","secondHit");
$replaceIt = array("\\341","\\116");
$sourceString = "this is the firstHit and this is the secondHit";
$sourceString = preg_replace($findIt,$replaceIt,$sourceString);
the problem is, what I want to result is the following literal text:
"this is the \341 and this is the \116"
but PHP is evaluating my backslashes as either backreferences, or escaped
characters, or something else. How can I pass a replace parameter so that
it is literally accepted, and not evaluated in some way?
By the way, when I pass:
$replaceIt = array("\\\\341","\\\\116");
I get:
"this is the \\341 and this is the \\116"
I can't afford to run stripSlashes on my resulting string, because it
would break other areas of the string. I need to trap this in the
preg_replace.
...and yes, I WOULD use str_replace, but it doesn't seem to work in IIS
with arrays passed as search & replace parameters. If anyone can verify
this, I'd be grateful!
Thanks so much,
michael
Michael Geary
Interactive Architect
SeraNova
(801) 437-5808
[EMAIL PROTECTED]
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]