Konvertierung von Daten aus JSON in PHP

Mit der Funktion json_decode kann man automatisch Daten vom JSON-Format in PHP-Strukturen umwandeln. Schauen wir uns ein Beispiel an. Nehmen wir an, wir haben das folgende JSON:

php<?php
  $json = '[1, 2, 3]';
?>

Wandeln wir die Daten in PHP um:

php<?php
  $data = json_decode($json);
?>

Sehen wir uns an, was herausgekommen ist:

php<?php
  var_dump($data); // Array [1, 2, 3]
?>
Задание 1

Wandeln Sie das folgende JSON in eine PHP-Struktur um:

php<?php
  $json = '[
    "x",
    "y",
    "z"
  ]';
?>