Write a PHP script which decodes the following JSON string.
Sample JSON code :{"Title": "The Cuckoos Calling","Author": "Robert Galbraith","Detail": {"Publisher": "Little Brown"}}
<?php function w3rfunction($value,$key) { echo "$key : $value"."\n"; } $a = '{"Title": "The Cuckoos Calling", "Author": "Robert Galbraith", "Detail": { "Publisher": "Little Brown" } }'; $j1 = json_decode($a,true); array_walk_recursive($j1,"w3rfunction"); ?>
Sample Output:
Title : The Cuckoos Calling Author : Robert Galbraith Publisher : Little Brown
total answers (1)
start bookmarking useful questions and collections and save it into your own study-lists, login now to start creating your own collections.
Sample Output:
need an explanation for this answer? contact us directly to get an explanation for this answer