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

oracle - The fastest way to check if some records in a database table? -

php - multilevel menu with multilevel array -

jQuery UI: Datepicker month format -