Jump to content

Why are my single and double quotes appearing with a "\" before them?


mjurmann

Recommended Posts

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!

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.

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.