Monday, 29 September 2014

stripcslashes in PHP

PHP stripcslashes() function is utilized to remove backslashes from given data included by the addslashes() function.

Syntax:

stripcslashes(string)
string : Required. Specifies the input string.

Tip : This function could be utilized to clean up a string recovered from a database.

Note : PHP stripcslashes() skips special character sets like "\n" and "\r", preserving any line breaks, return carriages, etc.

Example:

<?php
echo stripcslashes("Good \Morning, m\y name\ is Sam\.");
?>
Output will be:
Good Morning, my name is Sam.

0 comments:

Post a Comment