|
| 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:
|
|