Example
Remove the backslash in front of "World!":
<?php echo stripslashes("Hello World!"); ?>
Definition and usage
stripcslashes() Function Remove backslashes added by the addcslashes() function.
Tip: This function can be used to clean data retrieved from the database or from an HTML form.
Syntax
stripcslashes(string)
Parameters | Description |
string | Required. Specifies the string to be checked. |
Technical details
Return value: | Returns the unescaped string. |
PHP version: | 4+ |
addslashes function also "'" can be escaped directly.
The example is as follows:<?php $sql = "update book set bookname='let's go' where bookid=1"; echo $sql."<br/>"; $new_sql = addcslashes($sql,"'"); echo $new_sql."<br/>"; $new_sql_01 = stripcslashes($new_sql); echo $new_sql_01."<br/>"; echo addslashes($sql); ?>
update book set bookname='let's go' where bookid=1 update book set bookname=\'let\'s go\' where bookid=1 update book set bookname='let's go' where bookid=1 update book set bookname=\'let\'s go\' where bookid=1
The above is the detailed content of php removes backslashes added by addcslashes() function stripcslashes(). For more information, please follow other related articles on the PHP Chinese website!