Reputation: 23
I am new to PHP and trying to call this json to get all groupon divisons... I do not see the names. Not sure what is wrong.. any help ?
<?php
$divs = "https://partner-api.groupon.com/division.json';
$curldivs = curl_init($divs);
curl_setopt($curldivs, CURLOPT_RETURNTRANSFER, true);
$respdivs = curl_exec($curldivs);
curl_close($curldivs);
$divarry = json_decode($respdivs);
foreach($divarry->divisions as $divn)
{
echo $divn->name;
}
?>
Upvotes: 1
Views: 62
Reputation:
just change the line:
$divs = "https://partner-api.groupon.com/division.json';
to
$divs = "https://partner-api.groupon.com/division.json";
Upvotes: 0