note 114533 added to function.stripslashes
| From: | ivijan dot stefan at gmail dot com | Date: | Tue, 04 Mar 2014 15:29:47 +0000 |
| Subject: | note 114533 added to function.stripslashes | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-198784@lists.php.net to get a copy of this message | ||
Sometimes for some reason is happens that PHP or Javascript or some naughty insert a lot of
backslash. Ordinary function does not notice that. Therefore, it is necessary that the bit
"inflate":
<?php
function removeslashes($string)
{
$string=implode("",explode("\\",$string));
return stripslashes(trim($string));
}
/* Example */
$text="My dog don\\\\\\\\\\\\\\\\'t like the postman!";
echo removeslashes($text);
?>
RESULT: My dog don't like the postman!
This flick has served me wery well, because I had this problem before.
----
Server IP: 178.168.23.87
Probable Submitter: 95.85.188.25 (proxied: 95.85.188.25)
----
Manual Page -- http://php.net/manual/en/function.stripslashes.php
Edit -- https://master.php.net/note/edit/114533
Del: integrated -- https://master.php.net/note/delete/114533/integrated
Del: useless -- https://master.php.net/note/delete/114533/useless
Del: bad code -- https://master.php.net/note/delete/114533/bad+code
Del: spam -- https://master.php.net/note/delete/114533/spam
Del: non-english -- https://master.php.net/note/delete/114533/non-english
Del: in docs -- https://master.php.net/note/delete/114533/in+docs
Del: other reasons-- https://master.php.net/note/delete/114533
Reject -- https://master.php.net/note/reject/114533
Search -- https://master.php.net/manage/user-notes.php