public function htmlEncode($flags = null, $doubleEncode = true)
    {
        if ($flags === null) $flags = ENT_QUOTES | ENT_SUBSTITUTE;

        return $this->newSelf
        (
            UTF8::htmlentities
            (
                $this->scalarString,
                $flags,
                $this->encoding,
                $doubleEncode
            )
        );
    }
public function htmlEncode($flags = null, $doubleEncode = true)
    {
        if ($flags === null) $flags = ENT_QUOTES | ENT_SUBSTITUTE;

        return $this->newSelf
        (
            UTF8::htmlentities
            (
                $this->scalarString,
                $flags,
                $this->encoding,
                $doubleEncode
            )
        );
    }
public function htmlEncode ( $ flags = null , $ doubleEncode = true ) { if ( $ flags === null ) $ flags = ENT_QUOTES | ENT_SUBSTITUTE ; return $ this -> newSelf ( UTF8 :: htmlentities ( $ this -> scalarString , $ flags , $ this -> encoding , $ doubleEncode ) ) ; }
Convert all applicable characters to HTML entities.

@link http://php.net/manual/en/function.htmlentities.php

@param  int|null $flags        Optional flags.

@param  bool     $doubleEncode When double_encode is turned off PHP
will not encode existing html entities.
The default is to convert everything.

@return static                 String after being html encoded.
Convert all applicable characters to HTML entities .