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. Quote Link to comment 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! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.