PHP code example of muffeen / url-status

1. Go to this page and download the library: Download muffeen/url-status library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

muffeen / url-status example snippets


use Muffeen\UrlStatus\UrlStatus;

$urlStatus = UrlStatus::get('http://www.example.com');
$httStatusCode = $urlStatus->getStatusCode();
$responseHeaders = $urlStatus->getResponseHeaders();

use Muffeen\UrlStatus\UrlStatus;

$urlStatus = UrlStatus::get('http://www.example.com', array(
    CURLOPT_USERAGENT => '<user-agent-here>',
));
$httStatusCode = $urlStatus->getStatusCode();
$responseHeaders = $urlStatus->getResponseHeaders();