PHP stripslashes() Function
In this chapter you will learn:
- Definition for PHP stripslashes() Function
- Syntax for PHP stripslashes() Function
- Parameter for PHP stripslashes() Function
- Return for PHP stripslashes() Function
- Example - remove the slashes from string
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//j a v a 2 s . c om
$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.
Next chapter...
What you will learn in the next chapter:
- Definition for PHP stristr() Function
- Syntax for PHP stristr() Function
- Parameter for PHP stristr() Function
- Return for PHP stristr() Function
- Note for PHP stristr() Function
- Example - Find the first occurrence of
- Example - Find the ASCII code
- Example - Return the part of the string before the first occurence
Home » PHP Tutorial » PHP String Functions