Search
 
SCRIPT & CODE EXAMPLE
 

PHP

php curl print status

$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;
Comment

PREVIOUS NEXT
Code Example
Php :: how to create random alphanumeric in php 
Php :: laravel version check 
Php :: php replace spaces with dash 
Php :: var_dump smarty 
Php :: wp cron disable 
Php :: php uppercase 
Php :: codeigniter distinct 
Php :: migrate specific table laravel 
Php :: laravel validation pdf 
Php :: wordpress turn off php warnings 
Php :: create folder php 
Php :: access to this resource on the server is denied laravel 
Php :: Example wp-config.php for Debugging 
Php :: laravel catch exception ex log save 
Php :: laravel 8 previous page 
Php :: php date + one day 
Php :: php artisan route scan 
Php :: get last character of string php 
Php :: Your requirements could not be resolved to an installable set of packages. 
Php :: CLI to create a new laravel project 
Php :: php location 
Php :: check if valid url php 
Php :: delete image from public folder in laravel 
Php :: force https with php 
Php :: pi() in php 
Php :: Call to undefined function AppHttpControllerscurl_init() 
Php :: php string to array 
Php :: php timestamp to date 
Php :: laravel old request htmlselect 
Php :: complete url php 
ADD CONTENT
Topic
Content
Source link
Name
3+4 =