Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- {
- "11153" : {
- "sub" : {
- "11411" : {
- "id" : "994834",
- "source_api" : "all",
- "tanggal" : "2016-06-14",
- "instansi_id" : "11411",
- "belum" : "12",
- "proses" : "23",
- "selesai" : "7",
- "parent_nid" : "11153",
- "InstansiName" : "Dinas PSDA dan ESDM Kota Semarang",
- "sub" : [],
- "rtl" : "5.30"
- },
- }
- }
- }
- <?php
- $data = '{
- "11153" : {
- "sub" : {
- "11411" : {
- "id" : "994834",
- "source_api" : "all",
- "tanggal" : "2016-06-14",
- "instansi_id" : "11411",
- "belum" : "12",
- "proses" : "23",
- "selesai" : "7",
- "parent_nid" : "11153",
- "InstansiName" : "Dinas PSDA dan ESDM Kota Semarang",
- "sub" : [],
- "rtl" : "5.30"
- }
- }
- }
- }'; // initial data
- $new_array = json_decode($data,true); // decode data to convert it to array
- echo "<pre/>";print_r($new_array); // print the array
- echo $new_array[11153]['sub'][11411]['belum'];// you can print others like this
- $array=json_decode($json_string,true);
- <?php
- echo $array["11153"]["sub"]["11411"]["belum"]; // get belum
- echo $array["11153"]["sub"]["11411"]["proses"]; // get proses
- echo $array["11153"]["sub"]["11411"]["selesai"]; // selesai
- <?php
- echo $array["arraykey"][0];
- <?php
- for($i=0;$i<sizeof($array["arraykey"]);$i++) {
- echo $array["arraykey"][$i];
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement