Exception or error:
just…. don’t know why two strip slash function.
How to solve:
stripcslashes() skips special character sets like “\n” and “\r”, preserving any line breaks, return carriages, etc. that may be in the string.
stripslashes() simply removes any slashes it encounters without parsing anything beforehand.
Answer:
stripcslashes
does not simply skip the C-style escape sequences \a
, \b
, \f
, \n
, \r
, \t
and \v
, but converts them to their actual meaning. So
stripcslashes('\n') == "\n"
while
stripslashes('\n') == "n"
Note that '\n' == "\\n"
.