private $api_url= "www.myurl.com";
private $api_key = "111abjkbjkvsdf3879";
private function getpage($url, $redirect=FALSE) {
$url = $this->purge_url($url);
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
**/*Output the value of the array NULL NULL*/**
$p_result = curl_exec($ch);
$array = json_decode(trim($p_result), TRUE);
var_dump($array);
if ($redirect) curl_setopt($ch, CURLOPT_FOLLOWLOCATION, TRUE);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'GET');
if (!$page=curl_exec($ch)) {
$this->add_error("Remote GET connection to $url failed: ".curl_error($ch));
curl_close($ch);
return false;
}
curl_close($ch);
$this->xmlsource = $page;
return $page;
}
Output the value of the array in var_dump($array) is: NULL NULL Is the NULL in my case is the value or I did any mistake in my way to retrieve the value? I try to send APIkey request.