php method to convert special characters: 1. Use backslashes to quote strings through the addslashes function; 2. Use the htmlentities function to convert into html entities; 3. Convert specific characters into html through the htmlspecialchars function entity.
Recommended: "PHP Video Tutorial"
1. Addslashes() uses backslashes to quote strings
and
stripslashes() dequote a reference string
2. htmlentities(): Convert to html entity
and html_entity_decode(): Convert html Entities are converted into html tags
3. htmlspecialchars(): specific characters are converted into html entities
and htmlspecialchars_decode(): vice versa
The above is the detailed content of How to convert special characters in php. For more information, please follow other related articles on the PHP Chinese website!