これが初心者の質問である場合は申し訳ありませんが、[ids]
PHP を介して JSON 配列の値にアクセスする方法がわかりません。
なぜこれが機能しないのですか?
$jsonResponse = json_decode($response,true);
print $jsonResponse[2]["ids"];
これは JSON 配列です。
Array
(
[0] => analytics#gaData
[1] => https://www.googleapis.com/analytics/v3/data/ga?ids=ga:123455&dimensions=ga:eventCategory,ga:eventAction,ga:eventLabel&metrics=ga:visits,ga:pageviews&start-date=2013-01-01&end-date=2020-01-01
[2] => Array
(
[start-date] => 2013-01-01
[end-date] => 2020-01-01
[ids] => ga:123455
[dimensions] => ga:eventCategory,ga:eventAction,ga:eventLabel
[metrics] => Array
(
[0] => ga:visits
[1] => ga:pageviews
)
[start-index] => 1
[max-results] => 1000
)
[3] => 1000
[4] => 9