php-extended / php-ip-parser-object
A library that implements the php-extended/php-ip-parser-interface interface library.
Requires
Requires (Dev)
README
A library that implements the php-extended/php-ip-parser-interface interface library.
Installation
The installation of this library is made via composer.
Download composer.phar
from their website.
Then add to your composer.json :
"require": {
...
"php-extended/php-ip-parser-object": "^4",
...
}
Then run php composer.phar update
to install this library.
The autoloading of all classes of this library is made through composer's autoloader.
Basic Usage
You may use this library this following way:
use PhpExtended\Ip\Ipv4AddressParser;
use PhpExtended\Ip\IpAddressParseException;
$parser = new Ipv4AddressParser();
try
{
$ipv4 = $parser->parse("255.255.255.0");
}
catch(IpAddressParseException $e)
{
// do something
}
The same process is usable with the Ipv6
class, for version 6 of IP
protocol. This library provides also network classes to be able to evaluate
if a specific ip address is within a network.
/!\
This library does not support embedded ipv4 in ipv6 addresses /!\
License
MIT (See license file).