I need to insert (for example: "ABC") to my wamp db. I'm using str_replace method for this. Code is as shown below:
$currAddr=str_replace(array("'","\"", """),"'",htmlspecialchars($_POST["currentadd"]));
I'm trying to replace single quotes with a backslash and double quotes with a ' to my db because as per my code single & double quotes cant be inserted directly to db.
This code is not working as I expected. I'm not getting what's wrong in this. Any help here...