html($text, $keepTags = true)

Converts any text to valid HTML

  • $text (string)
  • $keepTags (boolean)
    Preserve HTML tags
  • return (string)

Example

With a single option

<?= html($page->title()) ?>

Don't preserve HTML tags

<?= html($page->title(), false) ?>