Encodes special characters (e.g. <, >, &, ") into HTML entities so they can be safely used in HTML content. Prevents injection and ensures characters display correctly.
Use when inserting user input into HTML or when building markup programmatically.