Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

PHP IPv6 Tools

branch: master

Fetching latest commit…

Octocat-spinner-32-eaf2f5

Cannot retrieve the latest commit at this time

Octocat-spinner-32 src
Octocat-spinner-32 test
Octocat-spinner-32 .gitignore
Octocat-spinner-32 .travis.yml
Octocat-spinner-32 LICENSE
Octocat-spinner-32 README.md
Octocat-spinner-32 build.xml
Octocat-spinner-32 composer.json
Octocat-spinner-32 phpunit.xml.dist
README.md

PHP IPv6 Tools

Build Status "Flattr This"

PHP IPv6 Tools (v6tools) is a small library that provides validation of IPv6 addresses, subnets and EUI64.

<?php
require('v6tools/autoload.php');

if (!v6tools\Runtime::isIPv6Supported()) {
    fprintf(STDERR, "No ipv6 support");
    exit(-1);
}

$ip = new v6tools\EUI64('2a01:198:603:0:224:d6ff:fe18:618c');
echo $ip->getMacAddress();
// echos 00:24:d6:18:61:8c

$ip = new v6tools\Subnet('2001::/16');
$ip->isInSubnet('2001::1');
// returns true
$ip->isInSubnet('2000::1');
// return false

License

Licensed under the terms of the MIT License with additional Beerware clause. If you like v6tools feel free to buy me beer.

Something went wrong with that request. Please try again.