chars - PHP is there a built-in function to render ' as ’ etc -


Is there an underlying function to present characters as identifiers (& rsquo;)?

Also, is it unsafe to output raw characters (like ') to HTML?

Thank you.

Try htmlentities () :

 < Code> HTMLentities ("'", ENT_QUOTES,' UTF-8 ', true);  

Regarding your second question, yes (as a general rule).

To output user input / raw input you should always htmlspecialchars () at least.


Comments

Popular posts from this blog

php - multilevel menu with multilevel array -

c# - TypeConverter in propertygrid only converts from string, not to -

jQuery UI: Datepicker month format -