php man page for addcslashes

Query: addcslashes

OS: php

Section: 3

Format: Original Unix Latex Style Formatted with HTML and a Horizontal Scroll Bar

ADDCSLASHES(3)								 1							    ADDCSLASHES(3)

addcslashes - Quote string with slashes in a C style

SYNOPSIS
string addcslashes (string $str, string $charlist)
DESCRIPTION
Returns a string with backslashes before characters that are listed in $charlist parameter.
PARAMETERS
o $str - The string to be escaped. o $charlist - A list of characters to be escaped. If $charlist contains characters , etc., they are converted in C-like style, while other non-alphanumeric characters with ASCII codes lower than 32 and higher than 126 converted to octal representation. 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. <?php echo addcslashes('foo[ ]', 'A..z'); // output: foo[ ] // All upper and lower-case letters will be escaped // ... but so will the []^_` ?> <?php echo addcslashes("zoo['.']", 'z..A'); // output: zoo['.'] ?>
RETURN VALUES
Returns the escaped string.
CHANGELOG
+--------+---------------------------------------------+ |Version | | | | | | | Description | | | | +--------+---------------------------------------------+ | 5.2.5 | | | | | | | The escape sequences v and f were added. | | | | +--------+---------------------------------------------+
EXAMPLES
$charlist like "..37", which would escape all characters with ASCII code between 0 and 31. Example #1 addcslashes(3) example <?php $escaped = addcslashes($not_escaped, "..37!@177..377"); ?>
SEE ALSO
stripcslashes(3), stripslashes(3), addslashes(3), htmlspecialchars(3), quotemeta(3). PHP Documentation Group ADDCSLASHES(3)
Related Man Pages
stripslashes(3) - php
pg_escape_string(3) - php
str_word_count(3) - php
addcslashes(3) - php
preg_quote(3) - php
Similar Topics in the Unix Linux Community
Combining many lines to one using awk or any unix cmd
Special characters
Reason why some commands need escaped-characters and other not
Grep on a list
Generate a string of alphanumeric characters