In addition to what @tal said, you can add
curl_setopt($curl, CURLOPT_FOLLOWLOCATION, true);
to make curl follow redirects. It’s in general a very good idea to do.
In addition to what @tal said, you can add
curl_setopt($curl, CURLOPT_FOLLOWLOCATION, true);
to make curl follow redirects. It’s in general a very good idea to do.