are some possibilities which make your result blank. Such as:
1. Curl error.
2. Redirection without response body and the curl doesn't follow the redirection.
3. The target host doesn't give any response body.
So here you have to find out the problem:
1. For the first possibility, use curl_error and curl_errno to confirm that the curl wasn't errored when its runtime.
2. For the second, use CURLOPT_FOLLOWLOCATION option to make sure the curl follows the redirection.
3. For the third possibility, we can use curl_getinfo. It returns an array which contains "size_download". The size_download shows you the length of the response body. If it is zero that is why you see a blank page when printing it.
Обсуждают сегодня