mjurmann Posted March 16, 2008 Share Posted March 16, 2008 Hello. Why are my single and double quotes appearing with a "\" before them? I'd like it to just echo out as "This guy's goose is cooked." Instead, it echoes as "This guy\'s goose is cooked." Is there any way to filter the string to fix this before it is echoed? Not just single quotes, but double quotes too. Thanks! Quote Link to comment Share on other sites More sharing options...
sasa Posted March 16, 2008 Share Posted March 16, 2008 stripslashes() Quote Link to comment Share on other sites More sharing options...
BlueSkyIS Posted March 16, 2008 Share Posted March 16, 2008 yes, magic quotes is turned on. you'll need to use stripslashes() to output slashed data without slashes. the reason for magic_quotes is to make it simpler to use user input in SQL queries, where single and double-quotes are special characters. Quote Link to comment Share on other sites More sharing options...
mjurmann Posted March 16, 2008 Author Share Posted March 16, 2008 Thanks guys, greatly appreciate the help. Quote Link to comment Share on other sites More sharing options...
PFMaBiSmAd Posted March 16, 2008 Share Posted March 16, 2008 Magic quotes have been eliminated in php6 because of all the problems and wasted time working around them. If you can, you should simply turn all the magic quote settings off in the master php.ini, a .htaccess file, or a local php.ini Quote Link to comment Share on other sites More sharing options...
BlueSkyIS Posted March 16, 2008 Share Posted March 16, 2008 good advice. i've grown used to them and should learn to do without. i should take your advice and turn off magic quotes too. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.