PHP:
Q: In Php code, when I want to urlencode apostrophes ('), and display it, it'll show me backslash with apostrophe (\'), not just apostrophe (').
A: In default configuration, magic_quotes_gpc is set to 'ON'. When magic_quotes are on, all ' (single-quote), " (double quote), \ (backslash) and NUL's are escaped with a backslash automatically.
You can call get_magic_quotes_gpc() (o for off, 1 for on). gpc means 'get, post, cookie'. You can use stripslashes(str) to remove the backslash.
Note: If the magic_quotes_sybase directive is also 'ON', it will completely override magic_quotes_gpc.
|