poppertom69 Posted June 18, 2007 Share Posted June 18, 2007 Right need help badly! If someone types 'Tom's Photos' into a input field i need a piece of code that removes the " ' " when the information is processed. Example Tom's Photos Script Processes Information Script Finds the " ' " in Tom's Script Removes " ' " in Tom's Result Is Toms Cheers for the help. Link to comment https://forums.phpfreaks.com/topic/56110-solved-getting-rid-of-inverted-commas/ Share on other sites More sharing options...
Orio Posted June 18, 2007 Share Posted June 18, 2007 Look into str_replace(), it does exactly what you need. Also keep in mind that you need to use stripslashes() if magic_quotes is on. Orio. Link to comment https://forums.phpfreaks.com/topic/56110-solved-getting-rid-of-inverted-commas/#findComment-277141 Share on other sites More sharing options...
cooldude832 Posted June 18, 2007 Share Posted June 18, 2007 <?php $string = "Tom's Photos"; $cleanstring = str_replace("'","",$string); ?> Link to comment https://forums.phpfreaks.com/topic/56110-solved-getting-rid-of-inverted-commas/#findComment-277143 Share on other sites More sharing options...
poppertom69 Posted June 19, 2007 Author Share Posted June 19, 2007 Thanks for your help it all works now. Cheers Link to comment https://forums.phpfreaks.com/topic/56110-solved-getting-rid-of-inverted-commas/#findComment-277486 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.