Removing quotes and slashes from POST data
Date: 10/26/05
(PHP Community) Keywords: no keywords
String = Don't tread on "me!"
$account['MESSAGE'] = stripslashes($_POST['MESSAGE']);
$search = array("\"","\'");
$replace = array("", "");
$account['MESSAGE'] = str_replace($search, $replace, $account['MESSAGE']);
Result = Don't tread on me!
***
How come this isn't catching the single quote?
Just changed the replace method - thanks:
$account['MESSAGE'] = str_replace('"',"",$account['MESSAGE']);
$account['MESSAGE'] = str_replace("'","",$account['MESSAGE']);
Source: http://www.livejournal.com/community/php/358460.html