mga_ka_php Posted July 21, 2010 Share Posted July 21, 2010 i have a form submission and it saves in my database. but sometimes i got weird characters, so when i display it on my site. the text content got weird error symbols. how do you handle those? thanks. Link to comment https://forums.phpfreaks.com/topic/208372-handling-weird-symbols/ Share on other sites More sharing options...
Stalingrad Posted July 21, 2010 Share Posted July 21, 2010 Is the data getting "corrupted"? Do you have users on your site? If you do, they might be inserting the "weird characters". You could use the strip_tags(); function for it? You could use the ereg_replace(); function as well... that lets you limit your string to whatever you want. Ex: only letters and/or numbers... Here is a sample I found from a Google search... ereg_replace("[^A-Za-z0-9]", "", $string); - this only allows letters and numbers. I hope this helped! Link to comment https://forums.phpfreaks.com/topic/208372-handling-weird-symbols/#findComment-1089061 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.