php-extended / php-mac-parser-object
This package is abandoned and no longer maintained.
The author suggests using the php-extended/php-mac-object package instead.
A library that implements the php-extended/php-ip-object-interface interface library.
4.0.17
2021-06-25 18:35 UTC
Requires
Requires (Dev)
README
A library that implements the php-extended/php-ip-object-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-mac-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\Mac\MacAddress48Parser;
use PhpExtended\Parser\ParseException;
$parser = new MacAddress48Parser();
$addr = '<put your mac address here>'; // "ff:ff:ff:ff:ff:ff" format
try
{
$mac = $parser->parse($addr);
}
catch(ParseException $e)
{
// does something
}
You can get back the first three bytes as integer with the $mac->getOui()
method and the three last bytes as integer with the $mac->getNic()
method.
License
MIT (See license file).