Forum Moderators: coopster
The benfit of that statement is to ensure that these special characters do have a backslash before them, and that it's not repeated. If the characters are already escaped, then stripslashes will remove them; if not, then stripslashes does nothing.
I have an escaped string:
$tmp = 'he\\o'; When I echo it, I get 'he\o'. So far, everything's good. However, when I do
echo addslashes ( stripslashes ( $tmp ) ) I get 'heo'. Why don't I get 'he\o' again? Thanks.
EDIT:
I'm so confused..
addslashes ( stripslashes ( 'he\\\\o' ) ) correctly evaluates to 'he\\o' but
addslashes ( stripslashes ( 'he\\o' ) ) echos as 'heo'.