note 34547 deleted from function.stripslashes by aidan
| From: | aidan@php.net | Date: | Sun, 29 Aug 2004 10:22:56 +0000 |
| Subject: | note 34547 deleted from function.stripslashes by aidan | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-75533@lists.php.net to get a copy of this message | ||
Note Submitter: webmaster at dragondev dot com
----
I was having trouble getting stripslashes to work in the right situation, so i made my own version
which works VERY well, it takes backslashes out of \" and \' of any string and can easily
be applied without changing the string contents, I also added a part at the end which makes html
returns (1 line breaks) out of \n but commented it out since this is the stripslashes function.
function unsuck(& $text)
{
if (strpos($text, "\'")){
do{
$text = str_replace("\'", "'", "$text");
}while(strpos($text, "\'"));
}else if (strpos($text, "\"")){
do{
$text = str_replace('\"', '"', "$text");
}while(strpos($text, '\"'));
}
//$text = str_replace('\n', '<BR>', "$text");
return($text);
}