Function h
Convenience method for htmlspecialchars.
Package: Cake
Link: https://book.cakephp.org/2.0/en/core-libraries/global-constants-and-functions.html#h
Copyright: Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)
License: MIT License
Located at Cake/basics.php
Link: https://book.cakephp.org/2.0/en/core-libraries/global-constants-and-functions.html#h
Copyright: Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)
License: MIT License
Located at Cake/basics.php
h( string|array|object $text , boolean|string $double = true , string $charset = null )
Parameters summary
string|array|object
$text
Text to wrap through htmlspecialchars. Also works with arrays, and objects.
Arrays will be mapped and have all their elements escaped. Objects will be string cast if they
implement a __toString method. Otherwise the class name will be used.
boolean|string
$double = true
Boolean - encode existing html entities. String - character set to use when escaping.
string
$charset = null
Character set to use when escaping. Defaults to config value in 'App.encoding' or 'UTF-8'
Returns
-
string|array|boolean|objectWrapped text, Wrapped Array or Wrapped Object.