PHP Decode nested""" JSON

Home - PHP Decode nested""" JSON

Jordan Maulana asked 3 years ago

i did it..
i can read data from my bucket with PHP..

but i really” hard to find any tutorial about decoding such JSON.
because the structure of received JSON is like 

class -> array -> class -> array

the result of PHP var_dump is like below :

object(stdClass)#31 (1) { [“results”]=> array(1) { [0]=> object(stdClass)#29 (4) { [“createdAt”]=> string(24) “2016-11-09T13:37:17.660Z” [“metadata”]=> object(stdClass)#16 (6) { [“do”]=> int(10) [“lat”]=> float(-7.275117) [“long”]=> float(112.79509) [“pH”]=> int(5) [“sal”]=> int(33) [“temp”]=> int(44) } [“objectId”]=> string(10) “7IaLsNOkWy” [“updatedAt”]=> string(24) “2016-12-08T15:20:22.919Z” } } }

many tutorials are just
-array
or
-class -> array
so i am really confused.

please help..

Jordan Maulana replied 3 years ago

object(result) -> array[result] -> object(bucket column) -> array[bucket column] -> object(metadata) -> array[metadata]
3 nested object + array. how can i parse this? please help

6 Answers
Best Answer
Badrullami Staff answered 3 years ago

Hi Jordan,
If you confused about metadata reponse after json_decode. Please add boolean true in the decode process. 
$bodyAuth = (string) $respAuth->getBody();
$auth = json_decode($bodyAuth, true);
print_r($auth);
You will get array format. 
Hope it’s help.

Scottked answered 3 months ago

https://kinoshkaivi15.wordpress.com
https://kinospark15.wordpress.com
https://filmeckrim1n5.wordpress.com
https://filmsstok12018.wordpress.com
https://kinosfeik1n5.wordpress.com
https://filmsnew12019.wordpress.com
https://kinosbigs148.wordpress.com
https://kinorom119.wordpress.com
https://filmsfeik12019.wordpress.com
https://kinoclok1n5.wordpress.com

[b]балканский рубеж фильм 2019 где посмотреть
балканский рубеж россия 1
российский фильм балканский рубеж
балканский рубеж фильм 2018 дата выхода
балканский рубеж дата выхода в россии
[/b]
[i]балканский рубеж торрент
скачать кино балканский рубеж торрент
балканский рубеж 2018 скачать торрент
смотреть новый фильм балканский рубеж
кино балканский рубеж
[/i]

Your Answer