By editor, 18 May, 2016 Question How to encode and decode JSON array/string in drupal 8 way like drupal_json_encode and drupal_json_decode in drupal 7 ? Example : use Drupal\Component\Serialization\Json; $json = Json::encode($data); $data = Json::decode($json); Tags Drupal 8 Code JSON Comments You must have JavaScript enabled to use this form. Your name Subject Comment About text formats Text format Plain textBasic_html Plain text No HTML tags allowed. Lines and paragraphs break automatically. Web page addresses and email addresses turn into links automatically.
Comments