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

<?php echo h($page->title()) ?>

Don't preserve HTML tags

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