Php addcslashes

Source: Internet
Author: User
Tags alphanumeric characters

Addcslashes-function adds a slash to 'and'

Description
String addcslashes ($ str, string $ charlist)
The parameters in the preceding and charlist are listed backslash character strings.

Escape this string.

Charlist
Character escape list.If charlist contains characters such as n and R, they are converted to the C style, and the ASCII code for other non-alphanumeric characters is less than 32 and higher than 126 to the octal character.

When you define the character sequence of the parameter in charlist, make sure that you know the characters between the characters, you set for the beginning and the end of the range

<? Php
Echo addcslashes ('foo [] ', 'A. Z');
// Output: foo []
// All upper and lower-case letters will be escaped
//... But so will the [] ^ _'
?>

Example
In charlist, if "0 .. 37", it will escape all the character code between 0 and 31 with ASCII.

Example 1 addcslashes () example

<? Php
$ Escaped = addcslashes ($ not_escaped, "... 37! @ 177 .. 377 ");
?>

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.