PHP Classes

Mac Address: Retrieve the Mac address of a network card

Recommend this page to a friend!
  Info   View files Example   View files View files (2)   DownloadInstall with Composer Download .zip   Reputation   Support forum (1)   Blog    
Ratings Unique User Downloads Download Rankings
StarStar 39%Total: 1,923 All time: 2,051 This week: 146Up
Version License PHP version Categories
mac-address 1.0Artistic License5.0Networking, PHP 5, Unix, Windows
Description 

Author

This class can be used to retrieve the Mac address of a network card.

It takes the name of a network card interface and executes a system command to retrieve the Mac address of that network card.

The class supports determining the Mac address on FreeBSD, Linux and Windows.

Picture of giulio
Name: giulio <contact>
Classes: 4 packages by
Country: Italy Italy
Age: 38
All time rank: 98036 in Italy Italy
Week rank: 258 Up11 in Italy Italy Up

Recommendations

mac address
Need to get mac address from login machine

Example

<?php

require_once (MacAddress.php");

$mac = new MacAddress ('00:FF:AB:CC:DD:FF');

echo
$mac->output ('.',4)."\n"; // 00FF.ABCC.DDFF

echo
$mac->output ('.',4,'lower')."\n"; // 00ff.abcc.ddff
echo
$mac->output ('-',2,'upper')."\n"; // 00-FF-AB-CC-DD-FF
echo
$mac->output (':',2,'lower')."\n"; // 00:ff:ab:cc:dd:ff

$mac2 = new MacAddress ($mac->GetMacAddr()); // mac of eth0 of my server
echo
$mac2->output (':',2,'lower')."\n"; // 00:50:56:ac:52:7b
echo
$mac2->output ('.',4,'lower')."\n"; // 0050.56ac.527b
echo
$mac2->output ('.',4,'upper')."\n"; // 0050.56AC.527B


?>


  Files folder image Files  
File Role Description
Accessible without login Plain text file example.php Example example file
Plain text file MacAddress.php Class Mac address main class

 Version Control Unique User Downloads Download Rankings  
 0%
Total:1,923
This week:0
All time:2,051
This week:146Up
 User Ratings  
 
 All time
Utility:66%StarStarStarStar
Consistency:66%StarStarStarStar
Documentation:-
Examples:-
Tests:-
Videos:-
Overall:39%StarStar
Rank:3863