etrader Posted January 24, 2011 Share Posted January 24, 2011 How can I replace ' and " with str_replace? When I using the following code, I will get error. $string = str_replace(""", "something", $string); Link to comment https://forums.phpfreaks.com/topic/225477-replacing-and-with-str_replace/ Share on other sites More sharing options...
dragon_sa Posted January 24, 2011 Share Posted January 24, 2011 $string = str_replace("\"", "something", $string); just need to escape it Link to comment https://forums.phpfreaks.com/topic/225477-replacing-and-with-str_replace/#findComment-1164306 Share on other sites More sharing options...
etrader Posted January 24, 2011 Author Share Posted January 24, 2011 Sounds simple! Thanks for solving it! Link to comment https://forums.phpfreaks.com/topic/225477-replacing-and-with-str_replace/#findComment-1164329 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.