PHP/cURL curl_exec() error? -
this first time using curl might silly error on part following code:
$ch = curl_init($url); curl_setopt($ch, curlopt_returntransfer, 1); $output = curl_exec($ch); curl_close($ch); echo $output;
prints "1". understanding curlopt_returntransfer should ensure curl_exec returns either 0 or content here it's behaving if curlopt_returntransfer hasn't been set true. missing obvious?
thanks!
i'd use guzzle, oop wrapper around curl. (though since you're using request, file_get_contents($url);
work fine). there's no real issue code, though. sure url valid?
also, check make sure curl_setopt
returning true each call it, , try setting curlopt_url using function.
Comments
Post a Comment