LemonStand Documentation

h

function h($str)

Returns string in HTML-safe format, converting all applicable characters to HTML entities. Use this function every time you need to output data created by users.

Parameters

  • $str - string. A string value to process.

Return value

Returns string.

Examples

The following code outputs a product name.

<p>Product: <?= h($product->name) ?></p>

Next: include_resources
Previous: format_currency
Return to Reference