Table of Contents

Syntax

string addcslashes(string $str, string $characters)

(PHP 4, PHP 5)

$str The string to manipulate (add escape characters)
$characters A list of characters which will be escaped. You may define a range of characters using the notation A..z (this escapes all characters A-Z and a-z)
RETURNS Returns the modified string with the specified characters escaped

What it Does

Escapes a specified list of charcters in a string with a backslash (\). This is useful for certain programs which require special characters to be escaped.

Example

$test = addcslashes("Just an example", "x");
echo $test;

Outputs:

Just an e\xample
 
addcslashes.txt · Last modified: Apr 18, 2008 - 2:00pm (external edit)
 
Recent changes RSS feed Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki