str::html($string, $keepTags = true)

Converts a string to a html-safe string

  • $string (string)
  • $keepTags (boolean)
    True: lets stuff inside html tags untouched.
  • return (string)
    The html string

Example

<?php

echo str::html('some <em>über crazy</em> stuff');
// output: some <em>&uuml;ber crazy</em> stuff

echo str::html('some <em>über crazy</em> stuff', false);
// output: some &lt;em&gt;&uuml;ber crazy&lt;/em&gt; stuff

Is something missing or incorrect? Edit this page on Github…