src/sb/String/HTML.php
public static function escape($mixed, $quote_style = ENT_QUOTES, $charset = 'UTF-8')
    {

        if (is_string($mixed)) {
            $mixed = htmlspecialchars($mixed, $quote_style, $charset);
        } elseif (is_object($mixed) || is_array($mixed)) {
            foreach ($mixed as $k => &$v) {
                if ($v) {
                    if (is_object($mixed)) {
                        $mixed->$k = self::escape($v, $quote_style, $charset);
                    } else {
                        $mixed[$k] = self::escape($v, $quote_style, $charset);
                    }
                }
            }
        }

        return $mixed;
    }
public static function escape($mixed, $quote_style = ENT_QUOTES, $charset = 'UTF-8')
    {

        if (is_string($mixed)) {
            $mixed = htmlspecialchars($mixed, $quote_style, $charset);
        } elseif (is_object($mixed) || is_array($mixed)) {
            foreach ($mixed as $k => &$v) {
                if ($v) {
                    if (is_object($mixed)) {
                        $mixed->$k = self::escape($v, $quote_style, $charset);
                    } else {
                        $mixed[$k] = self::escape($v, $quote_style, $charset);
                    }
                }
            }
        }

        return $mixed;
    }
public static function escape ( $ mixed , $ quote_style = ENT_QUOTES , $ charset = 'UTF-8' ) { if ( is_string ( $ mixed ) ) { $ mixed = htmlspecialchars ( $ mixed , $ quote_style , $ charset ) ; } elseif ( is_object ( $ mixed ) || is_array ( $ mixed ) ) { foreach ( $ mixed as $ k => & $ v ) { if ( $ v ) { if ( is_object ( $ mixed ) ) { $ mixed -> $ k = self :: escape ( $ v , $ quote_style , $ charset ) ; } else { $ mixed [ $ k ] = self :: escape ( $ v , $ quote_style , $ charset ) ; } } } } return $ mixed ; }
Recursively htmlspecialchars string properties of objects and arrays
@param mixed $mixed The object or array to convert
@param int $quote_style ent quote style from htmlspecialchars
@param string $charset The charset from  htmlspecialchars
@return type
Recursively htmlspecialchars string properties of objects and arrays