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? Link to comment https://forums.phpfreaks.com/topic/67057-remove-characters-from-post-array/ 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? Link to comment https://forums.phpfreaks.com/topic/67057-remove-characters-from-post-array/#findComment-336281 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. Link to comment https://forums.phpfreaks.com/topic/67057-remove-characters-from-post-array/#findComment-336289 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); Link to comment https://forums.phpfreaks.com/topic/67057-remove-characters-from-post-array/#findComment-336297 Share on other sites More sharing options...
effigy Posted August 28, 2007 Share Posted August 28, 2007 Why not escape them? Link to comment https://forums.phpfreaks.com/topic/67057-remove-characters-from-post-array/#findComment-336308 Share on other sites More sharing options...
Jessica Posted August 28, 2007 Share Posted August 28, 2007 That's what I keep asking Link to comment https://forums.phpfreaks.com/topic/67057-remove-characters-from-post-array/#findComment-336311 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.