If magic_quotes_gpc is set to 1, then those quotes would be escaped.
I would recommened using:
//for storage to database
function prepIn($input) {
$input = trim($input);
if (!get_magic_quotes_gpc()) {
return addslashes($input);
}
return $input;
}
//for o/p to html page, textbox or textarea
function prepOut($output) {
$output = stripslashes($output);
return htmlspecialchars($output);
}