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 of curl_exec() instead of outputting it out directly.


Have you tried?

curl_setopt($ch, CURLOPT_VERBOSE, 0);

This worked for me!