How to Find a MAC Address

Posted: July 5, 2013 in All Category

Get mac address by this function

function mac_address()
{
exec(“ipconfig /all”, $output);
foreach($output as $line){
if (preg_match(“/(.*)Physical Address(.*)/”, $line)){
$mac = $line;
$mac = str_replace(“Physical Address. . . . . . . . . :”,””,$mac);
}
}
return $mac;
}

Advertisements

Comments are closed.