Actually, that is not very efficient.
If magic_quotes_gpc is set to 1, incoming variables would already be escaped.
As such, you dont need to use addslashes().
I suggest
//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);
}
as possible methods to deal with this.
In your example DeltaRho2K, there is no difference.
stripslashes() should not be used at all.
rather, it should only be used when retrieving from the database.