Introduction
Certain characters should not be used as plain text in HTML markup but should instead be represented by their respective HTML entities in order to preserve their meanings. When writing HTML this is a straightforward process – you type the HTML entity rather than the special character. But what happens when you have some plain text containing these characters (out of a database, for example) that you need to display? PHP has a function that will take a string and convert special characters to their HTML entities for you.
(more…)







