public function escape($string, $flags = null) {
        if ($flags === null) {
            $flags = ENT_QUOTES;
        }

        $flags |= ENT_SUBSTITUTE;

        return htmlentities($string, $flags, 'UTF-8', false);
    }
public function escape($string, $flags = null) {
        if ($flags === null) {
            $flags = ENT_QUOTES;
        }

        $flags |= ENT_SUBSTITUTE;

        return htmlentities($string, $flags, 'UTF-8', false);
    }
public function escape ( $ string , $ flags = null ) { if ( $ flags === null ) { $ flags = ENT_QUOTES ; } $ flags |= ENT_SUBSTITUTE ; return htmlentities ( $ string , $ flags , 'UTF-8' , false ) ; }
Escape HTML characters amd entities.

@param string $string
@param int $flags
@return string
Escape HTML characters amd entities .