PHP Tutorial - 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
$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.