I'm trying to extract data from the Api link with Curl. The problem is that my link have no fields posted. I have tried this but I got an error:
Notice: Undefined variable: xml in C:\wamp\www\OOP PHP\GetHtml.php on line 17
The code is as given below:
$handle=curl_init();
$url="https://www.domain.com/api/list/0/";
curl_setopt($handle, CURLOPT_URL, $url);
$result = curl_exec($handle);
//$xml=simplexml_load_string($result);
//$json=json_encode($xml);
//$array=json_decode($json,TRUE);
curl_close($handle);
print_r($xml);
I also tried with 'file_get_html' still not working, if there is a good solution please help me.
p.s: After 4 hours of searching everyone was using 'file_get_html' and it's working perfectly but not always, and also i've found a solution using 'HttpSocket' in Cakephp, and as i'm just a novice in Cakephp i can't work with it.
Sorry i'm so damn sleepy !!!