curl_exec() returns partial response with CURLOPT_RETURNTRANSFERon?

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

I'm trying to use the curl functions to retrieve a page from a remote
webserver and save the content in a variable for further processing.

I go through the process of curl_init(), curl_setopt(), and curl_exec(),
but when I have CURLOPT_RETURNTRANSFER on, curl_exec only returns part
of the remote page. When I turn CURLOPT_RETURNTRANSFER off, the entire
remote page gets sent to my browser.

So what do I need to do to get curl_exec() to return the complete page
with CURLOPT_RETURNTRANSFER on? Is there something I'm missing? I've
investigated CURLOPT_BUFFERSIZE and CURLOPT_WRITEFUNC; the first doesn't
seem to work, and I can't figure out how to use the second to do what I

Any advice would be gratefully appreciated.

Site Timeline