curl_exec printing results when I don't want to
Set CURLOPT_RETURNTRANSFER
option:
// ...
curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
$result = curl_exec($ch);
Per the docs:
CURLOPT_RETURNTRANSFER
-TRUE
to return the transfer as a string of the return value ofcurl_exec()
instead of outputting it out directly.
Have you tried?
curl_setopt($ch, CURLOPT_VERBOSE, 0);
This worked for me!