You must have to provide full/absolute path for file name when running it from cron. You must be using cookie with your curl, and that is lacking of absolute path. Hence the cookie is not working and you are getting wrong content.
curl_setopt($ch, CURLOPT_COOKIEJAR, 'cookie.txt');
curl_setopt($ch, CURLOPT_COOKIEFILE, 'cookie.txt');
So cookie.txt
should be /home/tmp/cookie.txt