FRIHOSTFORUMSFAQTOSBLOGSDIRECTORY
You are invited to Log in or Register a Frihost Account!

Converting \" into "...

 


Tartaglia
I have an update system that works well. Thing is, when you type either " or ' in a post, it shows up as \" or \'. Is there a way to change it back to exclude the slash?
MrBlueSky
If only the characters ", ', \ and the NULL character are escaped using backslashes you can use stripslashes():

Code:


$text = stripslashes($text);

Tartaglia
Thank you. That solved my problem. I have a lot to learn about php...
gerpg
Code:
stripslashes();


the reason it adds the slashes is to prevent the php from reading the quotes as part of the code and then messing up all the tags you have the data inside.
Stubru Freak
You can also just disable that by placing this line in your .htaccess file:
php_flag magic_quotes_gpc Off

It will soon be removed from the official PHP distribution, so get used to it.
Reply to topic    Frihost Forum Index -> Scripting -> Php and MySQL

FRIHOST HOME | FAQ | TOS | ABOUT US | CONTACT US | SITE MAP
© 2005-2007 Frihost, forums powered by phpBB.