Friday, 13 September 2013

Array with colon

Array with colon

facing some problems with array with colon in the name,
my $result is containing
gapiReportEntry Object
(
[metrics:private] => Array
(
[uniquePageviews] => 1520
)
[dimensions:private] => Array
(
[pagePath] => /
[pageTitle] => Eventyrgolf
[source] => google
[medium] => organic
[campaign] => (not set)
)
)
But some how i cannot get the "dimensions:private"... What to do?
I tried print_r():
$result->{"dimensions:private"}
$result['dimensions:private']
$result->dimensions
Full code:
$ga->requestReportData($profileId, $dimensions, $metrics, $sort, null,
$fromDate, $toDate, 2, 30);
foreach ($ga->getResults() as $result) {
print_r($result->dimensions);
}

No comments:

Post a Comment