konqi Posted August 28, 2007 Share Posted August 28, 2007 OK, I have a form and I want to remove " and ' characters from the $_POST array, how can I do this? and no I do not want to add slashes to them or anything like that, I want to remove them... so any help? Quote Link to comment Share on other sites More sharing options...
Jessica Posted August 28, 2007 Share Posted August 28, 2007 str_replace("'", '', $_POST); str_replace('"', '', $_POST); Why do you want to do that? What is wrong with quotes? Quote Link to comment Share on other sites More sharing options...
konqi Posted August 28, 2007 Author Share Posted August 28, 2007 I tried that it didn't work... basically I am trying to create a csv file that is seperated by tabs. Double quotes or single quotes are used for certain reasons in csv files and I just want to remove user inputed " and ' for ease, theres no reason for them really to use enter them anyway. Quote Link to comment Share on other sites More sharing options...
Jessica Posted August 28, 2007 Share Posted August 28, 2007 So your input can't have proper grammar? $newArray = str_replace("'", '', $_POST); $newArray = str_replace('"', '', $newArray); Quote Link to comment Share on other sites More sharing options...
effigy Posted August 28, 2007 Share Posted August 28, 2007 Why not escape them? Quote Link to comment Share on other sites More sharing options...
Jessica Posted August 28, 2007 Share Posted August 28, 2007 That's what I keep asking 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.