开发者

In PHP, what's the diff between 'stripcslashes' and 'stripslashes'?

开发者 https://www.devze.com 2022-12-10 16:14 出处:网络
just.... don\'t know开发者_开发知识库 why two strip slash function.stripcslashes() skips special character sets like \"\\n\" and \"\\r\", preserving any line breaks, return carriages, etc. that may be

just.... don't know开发者_开发知识库 why two strip slash function.


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.


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".

0

精彩评论

暂无评论...
验证码 换一张
取 消