Php obtains the MAC address of the NIC. Windows/LINUX is supported.
Source: Internet
Author: User
This article mainly introduces how to use php to obtain the MAC address of the NIC to support WINLINUX. For more information, see
The code is as follows:
/**
Obtain the MAC address source code of the NIC. Currently, Windows/LINUX systems are supported.
Obtain the physical (MAC) address of the machine Nic
**/
Class GetMacAddr {
Var $ return_array = array (); // returns a string array with a MAC address.
Var $ mac_addr;
Function GetMacAddr ($ OS _type ){
Switch (strtolower ($ OS _type )){
Case "linux ":
$ This-> forLinux ();
Break;
Case "solaris ":
Break;
Case "unix ":
Break;
Case "aix ":
Break;
Default:
$ This-> forWindows ();
Break;
}
$ Temp_array = array ();
Foreach ($ this-> return_array as $ value ){
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.