← All built-ins / htmlentities()
htmlentities()
htmlentities(string $s): string
Parameters
| Name | Type | Description |
|---|---|---|
| $s | string | text to escape |
Return value
The text with HTML-critical characters converted to entities.
Example
echo htmlentities("<b>Tom & Jerry</b>");<b>Tom & Jerry</b>