1. Go to this page and download the library: Download skrip42/mac-address library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
skrip42 / mac-address example snippets
MacAddress::isValid($macAddress); //check MAC-address for validity
MacAddress::isHex($macAddress); //check MAC-address for validity hex format
MaxAddress::isDec($macAddress); //check MAC-address for validity dec format
MacAddress::fromHex($macAddress); //create MacAddress instance from any valid hex MAC-address
MacAddress::fromDec($macAddress); //create MacAddress instance from any valid dec MAC-address
MacAddress::fromAuto($macAddress); //create MacAddress instance from any valid MAC-address (hex format priority)
MacAddress->to6colon(); //return MAC-address in 'hh:hh:hh:hh:hh:hh' format
MacAddress->to6dash(); //return MAC-address in 'HH-HH-HH-HH-HH-HH' format
MacAddress->to3dot(); //return MAC-address in 'hhhh.hhhh.hhhh'
MacAddress->toFormat( //return MAC-address in arbirary format
$delimiter, //delimiter for you format
$partCount, //count of MAC-address parts. for example f8f0.8216.242e has 3 parts, f8.f0.82.16.24.2e has 6.
$mode, //available value: 'hex','dec' default is 'hex'
$full, //use left-hand zero. default is true
$upper, //use uppercase format. default is false
$skipNull //skip empty parts. for example f8.f0.82.16..2e . default is false
);