protected function htmlEntityEncode($item)
    {
        if (is_array($item)) {
            array_walk_recursive($item, function (&$value) {
                $value = htmlentities($value);
            });
        } else {
            $item = htmlentities($item);
        }

        return $item;
    }
protected function htmlEntityEncode($item)
    {
        if (is_array($item)) {
            array_walk_recursive($item, function (&$value) {
                $value = htmlentities($value);
            });
        } else {
            $item = htmlentities($item);
        }

        return $item;
    }
protected function htmlEntityEncode ( $ item ) { if ( is_array ( $ item ) ) { array_walk_recursive ( $ item , function ( & $ value ) { $ value = htmlentities ( $ value ) ; } ) ; } else { $ item = htmlentities ( $ item ) ; } return $ item ; }
Convert characters to HTML entities recursively.

@param array|string $item

@return mixed
Convert characters to HTML entities recursively .