Download the PHP package hugsbrugs/php-http without Composer
On this page you can find all versions of the php package hugsbrugs/php-http. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package php-http
php-http
This library provides PHP utilities functions to manage URLs. Read PHP DOC
Install
Install package with composer
In your PHP code, load librairy
Configuration
In order to use cache mechanism, define following constants
Alternatively define path to the local stored public suffix list
This method should not be used in production since it's really slow.
Otherwise the default, not accurate, cache/public_suffix_list.dat file will be used.
Usage
Execute shell nslookup command
Check if an url is accessible (means not a 404)
Returns HTTP code for given URL
Cleans an url from its query parameters
Cleans an url from its query parameters and path
Quick and dirty function to save an image from the internet
Returns basic HTTP headers for a CURL request
Extracts suffix, tld, domain and subdomain from an URL
Extracts extention from an URL
Extracts scheme (ftp, http) from an URL
Extracts a TLD (Top Level Domain) from an URL
Extracts a sub domain from an URL
Extracts a domain name from an URL
Separates Headers from Body in CURL response
Sets a php script desired status code (usefull for API)
Gets the address and/or http code that the provided URL redirects to. $return can be : url/code/all
Follows and collects all redirects, in order, for the given URL.
Gets the address and/or http code that the URL ultimately leads to. $return can be : url/code/all
Check a TXT record in domain zone file
Waits and tests every minute if domain zone has correct IP adress and TXT record set
Tests if domain zone has correct IP adress and TXT record set
Get name servers of given domain
Add escaped fragment to URL
To enable CORS, put this line at top of your PHP script
Converts an URL to a filename It does not encode URL parameters (only scheme - domain - folders - file)
Dependecies
https://github.com/jeremykendall/php-domain-parser https://github.com/jeremykendall/php-domain-parser/tree/5.7.0 https://publicsuffix.org/list/public_suffix_list.dat
Unit Tests
Author
Hugo Maugey Webmaster | Consultant SEO | Fullstack developer
All versions of php-http with dependencies
true/punycode Version ~2.0
jeremykendall/php-domain-parser Version ^6.1.1
psr/simple-cache Version ^3.0
symfony/cache Version ^6.0
guzzlehttp/guzzle Version ^7.0