PHP Classes

PHP Get HTTP Status Code from URL: Access a page and return the HTTP status code

Recommend this page to a friend!
  Info   View files Example   Demos   View files View files (4)   DownloadInstall with Composer Download .zip   Reputation   Support forum (1)   Blog    
Ratings Unique User Downloads Download Rankings
Not yet rated by the usersTotal: 171 All time: 8,794 This week: 156Up
Version License PHP version Categories
php-get-http-status 1.0MIT/X Consortium ...5HTTP, PHP 5, Testing
Description 

Author

This class can access a page and return the HTTP status code.

It sends a HTTP request to a page with a given URL and retrieves the response.

The class returns the server response status code number so it is possible to determine if the page is available or not.

Recommendations

Link Checker
Find broken links in a Web site

Picture of Jason Olson
  Performance   Level  
Name: Jason Olson is available for providing paid consulting. Contact Jason Olson .
Classes: 4 packages by
Country: United States United States
Age: ???
All time rank: 3226434 in United States United States
Week rank: 180 Up20 in United States United States Up
Innovation award
Innovation award
Nominee: 1x

Example

<?php
/**
 * Copyright (c) 2019. ReddingWebPro / Jason J. Olson, This program is free software: you can redistribute it and/or
 * modify it under the terms of the GNU General Public License as published by the Free Software Foundation version 3
 * of the License.
 * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without
 * even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
 * for more details. You should have received a copy of the GNU General Public License along with this program. If not,
 * see <https://www.gnu.org/licenses/>.
 */

/**
 * Created by ReddingWebPro/ReddingWebDev
 * User: Jason J. Olson
 * License: GNU GPLv3
 * GitHub: https://github.com/reddingwebpro/php-get-http-status
 * Date: 3/6/2019
 */

require 'httpStatus.php';
$url = "https://google.com"; // url to test
$http = new \RedWebDev\httpStatus();
$status = $http->status($url);


  Example LinkExternal page  

Open in a separate window

  Files folder image Files  
File Role Description
Accessible without login Plain text file example.php Example Example script
Plain text file httpStatus.php Class Class source
Accessible without login Plain text file LICENSE Lic. License text
Accessible without login Plain text file readme.md Doc. Documentation

 Version Control Unique User Downloads Download Rankings  
 100%
Total:171
This week:0
All time:8,794
This week:156Up