h($text, $keepTags = true)

Converts any text to valid HTML (shortcut for html())

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

Example

With a single option

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

Don't preserve HTML tags

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