# Entities

Encode a string with HTML entities via PHP's [htmlentities()][entities] function. This is the opposite of the [decode][decode] modifier.

```yaml
string: "The 'bacon' is <b>crispy</b>"
```

::tabs

::tab antlers
```antlers
{{ string | entities }}
```
::tab blade
```blade
{{ Statamic::modify($string)->entities() }}
```
::

```html
The &#039;bacon&#039; is &lt;b&gt;crispy&lt;/b&gt;
```

[entities]: http://php.net/manual/en/function.htmlentities.php
[decode]: /modifiers/decode
