1

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;

}
?>
apptikka
  • 23
  • 4

1 Answers1

0

just change the line:

$divs = "https://partner-api.groupon.com/division.json';

to

$divs = "https://partner-api.groupon.com/division.json";