I have a string with single quotes in them...
eg.
$string = "Hey, I\'m great!";
The problem is when I print out the string I don't want the \ to print. How can I get away with doing this.
I need the function that removes a special character.
Thanks!
If you assign $string as:
$string = "hey, I'm great!";
you should have no problems.
An aside, if you want double/single quotes in strings then you can use:
$s = <<<X <FORM name="form1" method="GET" action="any.php"> X;
echo $s;
The thing is I know a single quote would work, but when I echo the string, I don't want to see the quote.
Eg.
$string = "Hey, I'm doing great!";
// some function to remove single quote in string.. ($string);*
echo $string;
THis should print out
Hey, Im doing great!
um yes PHP has a setting called Magic_Quotes_GPC which adds escape slashes in front of any chars that need them in GET data, POST data, or COOKIE data ... while this can be useful, it can also be a massive pain in the arse- use stripslashes() to get rid of them.
Arta.