在 print_r($segments) 之后,我的数组的输出与此类似:
Array
(
[kind] => analytics#segments
[username] => account@gmail.com
[totalResults] => 2334
[startIndex] => 1
[itemsPerPage] => 1000
[items] => Array
(
[0] => Array
(
[id] => -1
[kind] => analytics#segment
[selfLink] => https://www.googleapis.com/analytics/v3/management/segments/gaid::-1
[segmentId] => gaid::-1
[name] => All Visits
[definition] =>
)
...
[999] => Array
(
[id] => -1
[kind] => analytics#segment
[selfLink] => https://www.googleapis.com/analytics/v3/management/segments/gaid::-1
[segmentId] => gaid::-1
[name] => All Visits
[definition] =>
)
)
)
这个数组是谷歌分析 API PHP 的输出,它显示的最大值是itemsPerPage参数中提到的1000行,但我确实有超过 1000 行,接近totalResults参数 中提到的2334行。
有人知道如何强制它一次显示所有输出吗?
当我运行这个:
$nextLink = $results->getNextLink()
? $results->getNextLink() : 'none';
print($nextLink);
Accoring to this
文档 I have to use the parameter called
最大结果 to display more results per page, but I have no idea how to do so, no much documentation about it.
知道如何使用max-results参数或链接获取其余结果吗?