Get the Visitors of last week via the API


#1

Hi,

i have a problem:
Currently I am building a visitors counter so our visitors can view the statictics.
They will be able to view the Visitors of
"Today",“Yesterday”,“This Week”,“Last Week”,"All"
I cannot get my PHP-Script to display the Value for "Last week"
My PHP-Script looks like the following:

<?php $token_auth = 'XXXXXXXXXXXXXXXXXXXX'; //For this week $url = "http://www.xxxxx.de/piwik/"; $url .= "?module=API&method=VisitsSummary.getVisits"; $url .= "&idSite=1&period=week&date=today"; $url .= "&format=PHP"; $url .= "&token_auth=$token_auth"; $fetched = file_get_contents($url); $content = unserialize($fetched); // case error if(!$content) { print("Error, content fetched = ".$fetched); } print("this week: $content
"winking smiley; //Fuer previous week $url = "http://www.xxxxx.de/piwik/"; $url .= "?module=API&method=VisitsSummary.getVisits"; $url .= "&idSite=1&period=week&date=previous1"; $url .= "&format=PHP"; $url .= "&token_auth=$token_auth"; $fetched = file_get_contents($url); $content = unserialize($fetched); // case error if(!$content) { print("Error, content fetched = ".$fetched); } print("previous week: $content
"winking smiley; ?>

My Problem is that the result of “last week” is an array and i do not know how to display it:
a:1:{s:24:“2011-05-30 to 2011-06-05”;d:3575;}

Could you help me, please?
Sorry for my bad english.