【发布时间】:2016-06-12 11:14:45
【问题描述】:
我有来自 google api 的以下数组,并且只想获取 id。我如何从以下获得 id。当我尝试获取尺寸时,它给我的尺寸为零。
Google_Service_Drive_FileList Object ( [collection_key:protected] => items
[internal_gapi_mappings:protected] => Array ( ) [etag] => [itemsType:protected]
=> Google_Service_Drive_DriveFile [itemsDataType:protected] => array [kind] =>
[nextLink] => [nextPageToken] => [selfLink] => [modelData:protected] => Array (
[items] => Array ( [0] => Array ( [id] => 0B0OnHwH_cQckeWZPdXFyRU5aMGs ) [1] =>
Array ( [id] => 0B0OnHwH_cQckaUVORkZaM2NoRXM ) [2] => Array ( [id] =>
1kCQLhEgzgeKO-L57ISWjQL4ctkxT4Gq2wrdzDFbrcac ) [3] => Array ( [id] =>
0B0OnHwH_cQckc3RhcnRlcl9maWxl ) [4] => Array ( [id] => 1-Yhs92vZnvUNArwAcZJZ9xa-
fXZ7ZgRrADyF-ikG1gU ) ) ) [processed:protected] => Array ( ) ) Array ( )
【问题讨论】:
-
在我看来像一个对象。
-
但是通过函数 gettype() 我得到了数组
-
我改变了获得这个结果的方式,现在它是对象。现在如何从这个对象中获取值