I have now tried a lot of different solutions but non of those curl settings has ever worked... I just want to get the sourcecode of the webpage back...
And yeah, I know there is file_get_contents()
. But I need and want to use curl instand of file_get_contents()
. Where is the error? How can I get the content of the webpage with curl?
$url = "https://google.de";
$curl = curl_init($url);
curl_setopt($curl, CURLOPT_CUSTOMREQUEST, "GET");
curl_setopt($curl, CURLOPT_HEADER, false);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
//curl_setopt($curl, CURLOPT_HTTPHEADER, array(
// "API-Token: " . APITOKEN . "",
// "API-Secret: " . APISECRET . "",
//));
$response = curl_exec($curl);
echo "This is the response...:\n" . $response;
$response
is always empty... Even if I save the variable to a text file... Here the picture which proves it!
Greetings and Thank You!