PHP stripslashes() Function

Definition

The stripslashes() function is the opposite of addslashes(). It removes one set of \-escapes from a string. For example:

Syntax

PHP stripslashes() Function has the following syntax.

string stripslashes ( string str )

Parameter

str is the string value to convert.

Return

PHP stripslashes() Function returns string value being stripped with slashes.

Example

Remove the slashes from string


<?PHP//from ww w  . j a  v a  2  s . co  m
$string = "this is a 'test' from java2s.com"; 
$a = addslashes($string); 
print $a;
print "\n";

$b = stripslashes($a); 
print $b;
?>

The code above generates the following result.





















Home »
  PHP Tutorial »
    Function reference »




PHP Array Functions
PHP Calendar Functions
PHP Class Functions
PHP Data Type Functions
PHP Date Functions
PHP File Functions
PHP Image Functions
PHP Math Functions
PHP MySQLi Functions
PHP SimpleXML Functions
PHP String Functions
PHP XML Functions
PHP Zip Functions