This is my first time using cURL so it might be a silly error on my part but the following code:
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$output = curl_exec($ch);
curl_close($ch);
echo $output;
Prints "1". It is my understanding that CURLOPT_RETURNTRANSFER should ensure that curl_exec returns either 0 or the content but here it's behaving as if CURLOPT_RETURNTRANSFER hasn't been set to true. Am I missing something obvious?
Thanks!
$urlreturns1in the body of the response - what do you get if you load it in a browser? What is in$url? What doesvar_dump($output);(instead ofecho) show?$xml = simplexml_load_file($url);not an option? Although your code should work, can you show your full actual code (minus passwords etc)?