Addcslashes
Support PHP4, PHP5
Support PHP4, PHP5
addcslashes - C-style slash string
Description
string addcslashes (string $str, string $charlist)
Returns a string with backslashes before the characters that are specified in the charlist parameter.
Parameters
str Text string
charlist
characters to be removed. If charlist contains the characters \n, \r, and others, they are converted to C-style. Other non-alphanumeric ASCI characters with lengths less than 32 and greater than 126 change.
When you define a sequence of characters in a charlist argument, make sure you know what characters you put as the beginning and end of the range.
echo addcslashes('foo[ ]', 'a..z');
// Values.
// Removes all upper and lower case letters
Return values
Returns the modified string.
Example
$escaped = addcslashes($not_escaped, "\0..\37!@\177..\377");
charlist \0..\37!@\177..\377, removes all characters with ASCII code between 0 and 31.