$info = curl_getinfo($ch, CURLINFO_HTTP_CODE); curl_close($ch); if ($info == 200){ return json_decode($result); }