We can check curl status as below
If $http_status = 200,then we have correct response. If ($http_status ="" || $http_status ="failed" ) then we have failed response or some error in the response.
$curl = curl_init(); curl_setopt($curl,CURLOPT_URL,'https://esoftsolutions4u.blogspot.com'); curl_setopt($curl, CURLOPT_RETURNTRANSFER, true); $result = curl_exec($curl); $http_status = curl_getinfo($curl, CURLINFO_HTTP_CODE); curl_close($curl);
If $http_status = 200,then we have correct response. If ($http_status ="" || $http_status ="failed" ) then we have failed response or some error in the response.
Comments
Post a Comment