Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to force an array to display all the values?
    text
    copied!<p>the output for my array look similar to this after print_r($segments): </p> <pre><code>Array ( [kind] =&gt; analytics#segments [username] =&gt; account@gmail.com [totalResults] =&gt; 2334 [startIndex] =&gt; 1 [itemsPerPage] =&gt; 1000 [items] =&gt; Array ( [0] =&gt; Array ( [id] =&gt; -1 [kind] =&gt; analytics#segment [selfLink] =&gt; https://www.googleapis.com/analytics/v3/management/segments/gaid::-1 [segmentId] =&gt; gaid::-1 [name] =&gt; All Visits [definition] =&gt; ) ... [999] =&gt; Array ( [id] =&gt; -1 [kind] =&gt; analytics#segment [selfLink] =&gt; https://www.googleapis.com/analytics/v3/management/segments/gaid::-1 [segmentId] =&gt; gaid::-1 [name] =&gt; All Visits [definition] =&gt; ) ) ) </code></pre> <p>This array is an output from google analytics API PHP, the max that it displayed me is <strong><em>1000</em></strong> rows as mentioned in the <strong><em>itemsPerPage</em></strong> parameter, but I do have more than 1000, close to <strong><em>2334</em></strong> as mentioned in <strong><em>totalResults</em></strong> parameter. </p> <p>Does some one have any idea how to force it to display all output at once?</p> <p>When I run this :</p> <pre><code> $nextLink = $results-&gt;getNextLink() ? $results-&gt;getNextLink() : 'none'; print($nextLink); </code></pre> <p>The output is a <strong>link</strong>: <a href="https://www.googleapis.com/analytics/v3/management/accounts/~all/webproperties/~all/profiles?start-index=1001&amp;max-results=1000" rel="nofollow">https://www.googleapis.com/analytics/v3/management/accounts/~all/webproperties/~all/profiles?start-index=1001&amp;max-results=1000</a></p> <p><code>Accoring to this</code> <a href="https://developers.google.com/apps-script/class_analytics_v3_schema_accounts" rel="nofollow">documentation</a> <code>I have to use the parameter called</code> <strong>max-results</strong> <code>to display more results per page, but I have no idea how to do so, no much documentation about it.</code></p> <p>Any idea how to get the rest of the results using the <strong>max-results</strong> parameter or the <strong>link</strong>? </p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload