dennismonsewicz Posted August 7, 2008 Share Posted August 7, 2008 How would I strip single quotation and double quotation marks? Quote Link to comment Share on other sites More sharing options...
discomatt Posted August 7, 2008 Share Posted August 7, 2008 $subject = str_replace( array("'", '"'), '', $subject ); Quote Link to comment Share on other sites More sharing options...
dennismonsewicz Posted August 7, 2008 Author Share Posted August 7, 2008 and this will strip quotations from posted info from like a textarea? Quote Link to comment Share on other sites More sharing options...
discomatt Posted August 7, 2008 Share Posted August 7, 2008 It will replace all instances of ' and " with an empty string... This doesn't take into account 'stylized' quotes outside of the ASCII range, but if you're trying to prevent injection it would work. Many prefer to replace them with backticks (`) or use mysql_real_escape_string as an alternative to completely removing them. Quote Link to comment Share on other sites More sharing options...
dennismonsewicz Posted August 7, 2008 Author Share Posted August 7, 2008 alright thanks! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.