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 styleSYNOPSISstring addcslashes (string $str, string $charlist)DESCRIPTIONReturns a string with backslashes before characters that are listed in $charlist parameter.PARAMETERSo $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 VALUESReturns the escaped string.CHANGELOG+--------+---------------------------------------------+ |Version | | | | | | | Description | | | | +--------+---------------------------------------------+ | 5.2.5 | | | | | | | The escape sequences v and f were added. | | | | +--------+---------------------------------------------+EXAMPLES$charlist like "