Jump to content

Escape Characters...?


Patrick3002

Recommended Posts

Hey, depends on the destination.

 

If you want it in the url, you use urlencode($string) -- then urldecode($string) when you need it back to normal.

 

If for a webpage, use htmlentities($string, ENT_QUOTES), and htmlspecialchars($string, ENT_QUOTES) to revert them back.

 

If for a mysql database, use mysql_real_escape_string($string, $database_resource)

 

For the simplest and easiest, but least secure: addslashes($string), and the opposite: stripslashes($string)

Link to comment
https://forums.phpfreaks.com/topic/39434-escape-characters/#findComment-190275
Share on other sites

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.