Devine Posted August 2, 2007 Share Posted August 2, 2007 How can I remove all the: ' from a variable? Link to comment https://forums.phpfreaks.com/topic/63094-solved-remove-from-variable/ Share on other sites More sharing options...
lightningstrike Posted August 2, 2007 Share Posted August 2, 2007 $string = str_replace("'","",$string); or you could escape it with addslashes($string); or mysql_real_escape_string($string); Link to comment https://forums.phpfreaks.com/topic/63094-solved-remove-from-variable/#findComment-314237 Share on other sites More sharing options...
Devine Posted August 2, 2007 Author Share Posted August 2, 2007 what about replacing \\ to \ Link to comment https://forums.phpfreaks.com/topic/63094-solved-remove-from-variable/#findComment-314243 Share on other sites More sharing options...
Salis Posted August 2, 2007 Share Posted August 2, 2007 I'd use stripslashes() to go from \\ to \ Link to comment https://forums.phpfreaks.com/topic/63094-solved-remove-from-variable/#findComment-314248 Share on other sites More sharing options...
Devine Posted August 2, 2007 Author Share Posted August 2, 2007 yea I just realized that, thanks. Link to comment https://forums.phpfreaks.com/topic/63094-solved-remove-from-variable/#findComment-314251 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.