Advertisement
GWibisono

json

Oct 29th, 2013
105
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <?php
  2. $s.='[{
  3.     "id":1,
  4.     "text":"City",
  5.     "children":[{
  6.         "id":11,
  7.         "text":"Wyoming",
  8.         "children":[{
  9.             "id":111,
  10.             "text":"Albin"
  11.         },{
  12.             "id":112,
  13.             "text":"Canon"
  14.         },{
  15.             "id":113,
  16.             "text":"Egbert"
  17.         }]
  18.     },{
  19.         "id":12,
  20.         "text":"Washington",
  21.         "state":"closed",
  22.         "children":[{
  23.             "id":121,
  24.             "text":"Bellingham"
  25.         },{
  26.             "id":122,
  27.             "text":"Chehalis"
  28.         },{
  29.             "id":123,
  30.             "text":"Ellensburg"
  31.         },{
  32.             "id":124,
  33.             "text":"Monroe"
  34.         }]
  35.     }]
  36. }]';
  37.  
  38. $json=json_decode($s, TRUE);
  39. echo '<pre>';print_r($json);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement