Check If Curl Request Is Successful Php

[Solved] Check If Curl Request Is Successful Php | Php - Code Explorer | yomemimo.com
Question : php curl print status

Answered by : shiny-stork

$url = 'http://www.example.com';
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_HEADER, true); // we want headers
curl_setopt($ch, CURLOPT_NOBODY, true); // we don't need body
curl_setopt($ch, CURLOPT_RETURNTRANSFER,1);
curl_setopt($ch, CURLOPT_TIMEOUT,10);
$output = curl_exec($ch);
$httpcode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);
echo 'HTTP code: ' . $httpcode;

Source : https://stackoverflow.com/questions/11797680/getting-http-code-in-php-using-curl | Last Update : Mon, 09 Mar 20

Question : test curl php

Answered by : nipun-agarwal

function _isCurl(){ return function_exists('curl_version');
}

Source : | Last Update : Mon, 13 Sep 21

Answers related to check if curl request is successful php

Code Explorer Popular Question For Php