Q:

Getting JSON from a URL

I am attempting to get a JSON string and it keeps coming up NULL and I am not sure why.  Can someone check to see if I got my code right? 
$url = "http:/engin.umich.edu/college/about/cal/event-calendar/futurejson";
     $ch = curl_init();
     curl_setopt($ch, CURLOPT_URL, $url);
     curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
     curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 5);
     $feed = curl_exec($ch);
     curl_close($ch);

    $data = json_decode($feed,true);

A:

 $url = "http://engin.umich.edu/college/about/cal/event-calendar/futurejson";
 // missing /  ^
 $ch = curl_init();
 curl_setopt($ch, CURLOPT_URL, $url);
 curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
 curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 5);
 // It's returning a redirect to www.engin.umich.edu
 curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
 $feed = curl_exec($ch);
 curl_close($ch);

 $data = json_decode($feed,true);

