iegorov
7/12/2013 - 9:00 AM

Get json using CURL

Get json using CURL

$ch = curl_init();
        curl_setopt($ch, CURLOPT_URL, 'http');
        // curl_setopt($ch, CURLOPT_FAILONERROR, 1);
        // curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
        curl_setopt($ch, CURLOPT_RETURNTRANSFER,1);
        // curl_setopt($ch, CURLOPT_POST, 1);
        // curl_setopt($ch, CURLOPT_POSTFIELDS, $post);
        $result = curl_exec($ch);
        curl_close($ch);
        $num = json_decode($result);