Php function stripslashes

Source: Internet
Author: User
: This article mainly introduces the php function stripslashes for handling multiple consecutive backslashes. if you are interested in PHP tutorials, refer to it. Php function: stripslashes ()

Remove the backlash. the string stripslashes (string $ str) function prototype returns a string (\ 'converted to' and so on) after the escape backlash is removed ).

On the official php website, return a string (\ 'converted to' and so on) after removing the escape backslash ). The double backslash (\) is converted to a single backslash (\). In fact, this is not accurate. I will test the result as follows:

In the case of multiple consecutive backlash, it cannot be ensured that there is no backslash in the returned characters after it is escaped, for example, if there are three consecutive backslashes, one will be retained ., After testing, the rule for this function to remove the backslash is: remove all two or two consecutive periods. if there are more than two, subtract 2 and divide it by 4. then, an integer is obtained, for example, after processing 7 consecutive backslashes, the number is ceil (7-2)/4) = 2, therefore, in actual use, we can replace more than three consecutive backslash values with three and then use this function. Note: This issue is not mentioned on the official php website.

This blog original, reproduced please specify the source: http://blog.csdn.net/u011474028

The above introduces the php function stripslashes for handling multiple consecutive backlash, including some content, hope to be helpful to friends who are interested in PHP tutorials.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.