In HTML, when certain characters are reserved, such as less than (<), greater than (>), the browser considers them to be labels, and some characters cannot be entered with the keyboard. If you need to display them correctly, you need to use character entities in the HTML source.
Character entities have two representations of entity name and entity number:
&entity_name; Entity Name
&entity_number; Entity numbers
If less than the number, can be written as < & #60;. Note: The advantage of using entity names instead of numbers is that names are easy to remember. The downside is that the browser may not support all entity names (the support for entity numbers is good).
A nonbreaking space ( ) is a commonly used character entity in HTML, and usually the browser will always truncate the space in the HTML page, leaving only one. To display multiple spaces in a page, you need to use the character entity.
In PHP, the function htmlspecialchars () function converts some pre-defined characters to HTML entities.
Attached: Useful character entities in HTML http://www.w3school.com.cn/tags/html_ref_entities.html
HTML entity characters