...

View Full Version : Replace "



phantom007
06-09-2007, 05:56 AM
Hey


Does anyone knows how do I replace a " (double quote) in a string with nothing

I tried the following but does not work


$message = str_replace(""","",$_REQUEST['txtMessage']);
or
$message = str_replace("""","",$_REQUEST['txtMessage']);
or
$message = str_replace("\"","",$_REQUEST['txtMessage']);


Plz help

Thanx

whizard
06-09-2007, 06:01 AM
Can we see code?

HTH
Dan

phantom007
06-09-2007, 06:09 AM
Its in my post itself.

whizard
06-09-2007, 06:15 AM
Yes I understand that, but if we can see the code around it we might be able to do a better job of diagnosing what's going on.

The third line of code you showed should do the trick

str_replace("\"","",$string);

What is happening when you use that?

Dan

_Aerospace_Eng_
06-09-2007, 06:18 AM
The third line as Dan pointed out should also work. Here is anothe way that works.

$message = str_replace('"','',$_REQUEST['txtMessage']);
echo stripslashes($message);



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum