note 9683 modified in AddCSlashes by zak
| From: | zak@php.net | Date: | Sun, 19 Nov 2000 04:03:46 +0000 |
| Subject: | note 9683 modified in AddCSlashes by zak | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-7877@lists.php.net to get a copy of this message | ||
When you define a sequence of characters in the charlist argument make sure that you know what
characters come between the characters that you set as the start and end of the range.
For example
print addcslashes ('foo[]', 'A..z');
// All upper and lower-case letters will be escaped
// ..but so will the [\]^_` and space characters.
Also, if the first character in a range has a lower ASCII value than the second character in the
range, no range will be constructed. Only the start, end and period characters will be escaped.
Use the ord() function to find the ASCII value for a character.
For example:
print addcslashes ("foo['.']", 'z..A');
http://www.php.net/manual/function.addcslashes.php