First string.PHP 8! has no lowercase letters → unchanged.
Second string. In Code123, uppercase C stays plain; o, d, and e become \o, \d, \e.
Careful. Prefer a..z / A..Z separately—avoid A..z unless you want the symbols in between.
Frequently Asked Questions
addcslashes() returns a new string with a backslash inserted before every character listed in the charlist argument. You choose exactly which characters to escape, unlike addslashes() which always escapes quotes, backslashes, and the NUL byte.
string addcslashes(string $str, string $charlist). The first parameter is the input string; the second is a list of characters (or ranges) to escape with a backslash.
Use two dots between endpoints, such as a..z or A..Z. The range follows ASCII order. Beware of A..z—it also includes characters between Z and a, like [ \ ] ^ _ `.
addslashes() always escapes single quotes, double quotes, backslashes, and NUL. addcslashes() lets you pick any characters via charlist. Use addcslashes() for selective escaping.
No. Use prepared statements (PDO or MySQLi) for database queries. addcslashes() is for general string escaping in custom contexts—not a substitute for proper SQL handling.