===== Syntax ===== string addslashes(string $str) //(PHP 4, PHP 5)// ^ $str | The string to manipulate (add escape characters) | ^ RETURNS | Returns the modified string with special 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. Specifically, if you are going to insert or update data in a ''MySQL'' database, these slashes are necessary to prevent errors and hacking attempts. Your PHP interpreter may add slashes to your GET, POST, and COOKIE variables automatically. This is known as ''magic quotes''. See the function [[get_magic_quotes_gpc]] for more information. ===== Example ===== $test = addslashes("Why can't we be friends?"); echo $test; Outputs: Why can\'t we be friends?