yii\helpers\BaseJson::htmlEncode PHP Method

htmlEncode() public static method

The method enhances json_encode() by supporting JavaScript expressions. In particular, the method will not encode a JavaScript expression that is represented in terms of a [[JsExpression]] object.
Since: 2.0.4
public static htmlEncode ( mixed $value ) : string
$value mixed the data to be encoded
return string the encoding result
    public static function htmlEncode($value)
    {
        return static::encode($value, JSON_UNESCAPED_UNICODE | JSON_HEX_QUOT | JSON_HEX_TAG | JSON_HEX_AMP | JSON_HEX_APOS);
    }