PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
I hope the forums display this properly, but I used htmlspecialchars to covert my strings in a form to their html equivilants then stored them in the mysql database. Now I want to display them on the site, when I call them up from the database he browser is showing them as their html (ie as ’).
I've looked into the php manuals for coverting back to their non html equivilant and it has lots of options, that work for just about all characters... except the ' which is ’ in html.
Does anyone have any ideas?! My brain is squirming on this one!
this is just a guess... but if you're using mysql_escape_string along with htmlspecialchars, user mysql_real_escape_string instead. This will take into account your charset.
scrotaye wrote:this is just a guess... but if you're using mysql_escape_string along with htmlspecialchars, user mysql_real_escape_string instead. This will take into account your charset.
Apologies, but I don't fully understand what you mean here?
This is my code I use to convert the string from the one I capture in the form: