Early Bird Registration for DrupalCon Portland 2024 is open! Register by 23:59 PST on 31 March 2024, to get $100 off your ticket.
By ianthomas_uk on
Change record status:
Published (View all published change records)
Project:
Introduced in branch:
8.x
Issue links:
Description:
drupal_json_encode()
has been moved to \Drupal\Component\Serialization\Json::encode()
and
drupal_json_decode()
has been moved to \Drupal\Component\Serialization\Json::decode()
.
Drupal 7:
$json = drupal_json_encode($data);
$data = drupal_json_decode($json);
Drupal 8:
use Drupal\Component\Serialization\Json;
$json = Json::encode($data);
$data = Json::decode($json);
Impacts:
Module developers