Hello,
I want to know how to turn off add slashes or remove slashes w/e it is. I have slashes that appear next to ' and " and it gets very annoying. Can I turn thiss off in my php.ini?
Thanks.
Turn off Addslashes
Moderator: General Moderators
- nickman013
- Forum Regular
- Posts: 764
- Joined: Sun Aug 14, 2005 12:02 am
- Location: Long Island, New York
- feyd
- Neighborhood Spidermoddy
- Posts: 31559
- Joined: Mon Mar 29, 2004 3:24 pm
- Location: Bothell, Washington, USA
Yes, you can turn it off in php.ini, however you should write your scripts to support the functionality being on or off.
get_magic_quotes_gpc() and get_magic_quotes_runtime() are used to detect when to run stripslashes() on a value.
The manual pages detail what php.ini settings affect them. Take notice of the notes placed on the pages too.
get_magic_quotes_gpc() and get_magic_quotes_runtime() are used to detect when to run stripslashes() on a value.
The manual pages detail what php.ini settings affect them. Take notice of the notes placed on the pages too.
here is a function written by arborint that removes those slashes... it can handle either a standard value (string) or an array of values (strings):
Code: Select all
function removeSlashes(&$var) {
if (is_array($var)) {
foreach ($var as $name => $value) {
if (is_array($value)) {
removeSlashes($value);
} else {
$var[$name] = stripslashes($value);
}
}
} else {
$var = stripslashes($var);
}
}- nickman013
- Forum Regular
- Posts: 764
- Joined: Sun Aug 14, 2005 12:02 am
- Location: Long Island, New York