public static Json::encode($variable)
Uses HTML-safe strings, with several characters escaped.
Overrides SerializationInterface::encode
File
- core/lib/Drupal/Component/Serialization/Json.php, line 17
Class
- Json
- Default serialization for JSON.
Namespace
Drupal\Component\Serialization
Code
public static function encode($variable) { // Encode <, >, ', &, and ". return json_encode($variable, JSON_HEX_TAG | JSON_HEX_APOS | JSON_HEX_AMP | JSON_HEX_QUOT); }
Please login to continue.