Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

parse json nested array form url in php

$json = '
{
    "type": "donut",
    "name": "Cake",
    "toppings": [
        { "id": "5002", "type": "Glazed" },
        { "id": "5006", "type": "Chocolate with Sprinkles" },
        { "id": "5004", "type": "Maple" }
    ]
}';

$yummy = json_decode($json, true);

echo $yummy['toppings'][2]['type']; //Maple
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #parse #json #nested #array #form #url #php
ADD COMMENT
Topic
Name
1+5 =