public static function toText(string $value, bool $double_encode = true) : string
    {
        return htmlspecialchars($value, ENT_QUOTES, 'utf-8', $double_encode);
    }
public static function toText(string $value, bool $double_encode = true) : string
    {
        return htmlspecialchars($value, ENT_QUOTES, 'utf-8', $double_encode);
    }
public static function toText ( string $ value , bool $ double_encode = true ) : string { return htmlspecialchars ( $ value , ENT_QUOTES , 'utf-8' , $ double_encode ) ; }
Convert special characters to HTML entities. All untrusted content
should be passed through this method to prevent XSS injections.

echo Html::toText('test');

@param  string  $value         String to convert
@param  bool    $double_encode Encode existing entities
@return string
Convert special characters to HTML entities . All untrusted content should be passed through this method to prevent XSS injections .