PHP

 Home  Computers & Internet  Web Programming PHP
What is PHP?
Echo
Comments
Variables
Constants
Data Types
number_format()
Character Strings
Mathematical Operators
Comparison Operators
Logical Operators
Joining Strings
explode()
implode()
strtolower()
strtoupper()
strlen()
ucfirst()
ucwords()
strrev()
str_replace()
str_repeat()
trim()
strip_tags()
addslashes()
stripslashes()
strpos()
strrpos()
nl2br()
isset()
unset()
empty()
POST
GET
If Statements
If Else Statements
Elseif Statements
Switch Statements
For Loops
While Loops
Do While Loops
Foreach Loops
File Create
File Open
File Read
File Write
File Delete
fgets()
file_get_contents()
Date & Time
$_SERVER
Sessions
Cookies
Arrays

HOW TO USE THE stripslashes() FUNCTION IN PHP

The stripslashes() function is used to remove backslashes that have been previously added to strings using the addslashes() function.

The general format is:

stripslashes(string);

Example:

$text="John O\' Sullivan";

$cleaned_string=stripslashes($text);

echo $cleaned_string;

The above outputs: John O' Sullivan

The stripslashes() function is extremely useful to remove backslashes from data that is retrieved from a database that has had backslashes added previously during insertion. After using the stripslashes() function, the data can now be outputted without the backslash character present.

See also:

addslashes() function


Home | Privacy Policy | Terms Of Use | Contact Us