Html::entities_deep PHP Method

entities_deep() static public method

Recursivly execute htmlentities on an Array
static public entities_deep ( $value ) : array
$value string or array
return array of value (same struct as input)
    static function entities_deep($value)
    {
        return is_array($value) ? array_map(array(__CLASS__, 'entities_deep'), $value) : htmlentities($value, ENT_QUOTES, "UTF-8");
    }

Usage Example

Example #1
0
 /**
  * Display a Warning
  *
  * @param $msg    string
  * @param $red    boolean (false by default)
  **/
 function displayWarning($msg, $red = false)
 {
     echo ($red ? "<div class='red'><p>" : "<p><span class='b'>") . Html::entities_deep($msg) . ($red ? "</p></div>" : "</span></p>");
     $this->log($msg, true);
 }
All Usage Examples Of Html::entities_deep
Html