⊗ppSpJnTD 15 of 83 menu

Converting Data from JSON to PHP

Using the function json_decode you can automatically convert data from JSON format to PHP structures. Let's look at an example. Suppose we have the following JSON:

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

Let's convert the data to PHP:

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

Let's see what we got:

<?php var_dump($data); // array [1, 2, 3] ?>

Convert the following JSON into a PHP structure:

<?php $json = '[ "x", "y", "z" ]'; ?>
English
AfrikaansAzərbaycanБългарскиবাংলাБеларускаяČeštinaDanskDeutschΕλληνικάEspañolEestiSuomiFrançaisहिन्दीMagyarՀայերենIndonesiaItaliano日本語ქართულიҚазақ한국어КыргызчаLietuviųLatviešuМакедонскиMelayuမြန်မာNederlandsNorskPolskiPortuguêsRomânăРусскийසිංහලSlovenčinaSlovenščinaShqipСрпскиSrpskiSvenskaKiswahiliТоҷикӣไทยTürkmenTürkçeЎзбекOʻzbekTiếng Việt
We use cookies for website operation, analytics, and personalization. Data processing is carried out in accordance with the Privacy Policy.
accept all customize decline