Monkuar Posted December 6, 2011 Share Posted December 6, 2011 Hello, I need a php function or some type of little parser that will find if a user submit's a ' then it converts it into " before I grab it and submit it into my database? How would I go about getting some code to convert all the input ' to " ? Thank you, Quote Link to comment https://forums.phpfreaks.com/topic/252615-replace-to/ Share on other sites More sharing options...
Psycho Posted December 6, 2011 Share Posted December 6, 2011 http://php.net/manual/en/function.str-replace.php Although, you should not be doing this if your intent is to prevent SQL Injection. Quote Link to comment https://forums.phpfreaks.com/topic/252615-replace-to/#findComment-1295063 Share on other sites More sharing options...
Monkuar Posted December 6, 2011 Author Share Posted December 6, 2011 http://php.net/manual/en/function.str-replace.php $ibforums->input['Post'] = str_replace ( "'", "\"", $ibforums->input['Post'] ); Thanks! Topic resolved! Quote Link to comment https://forums.phpfreaks.com/topic/252615-replace-to/#findComment-1295064 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.