我從json獲得一個數組,但我不知道如何獲得bookTitle和url。 如何讀取數組中的這些項目?我如何獲得JSON在PHP中
$data = file_get_contents('C:\Users\rsanchro\Desktop\ftp brasil4-9-2015\moderna_plus-historia\MPCH-C05-P1-1.0.1-ZIP-PT\resource.json');
$datos = json_decode($data, true);
print_r($datos);die;
Results:
Array
(
[topBarColor] => #000000
[bookId] => 2aef55bf3a9dec377b4f16a8048c7f84
[bookTitle] => História
[unitId] => MPCH-C05-P1
[unitTitle] => 108-127-MPCH-C05-P1-M
[unitResources] => Array
(
[0] => Array
(
[type] => 03
[url] => resources/mphis_c06av_escultura_ontem.mp4
[urlToShowInsideUnit] => #/compId/id0a33b2a0471e0f444bc0a88b5bb55714
[title] => A escultura ontem e hoje
[page] => 123
)
)
)
可能重複http://stackoverflow.com/questions/29308898/how-do-i-extract-data-from-json-with-php) –