php get client mac
<?php
function getClientMac($ip = '')
{
if (empty($ip)) {
return;
}
$command = sprintf("cat /proc/net/arp | grep %s | awk '{print $4}'", $ip);
$fd = popen($command, 'r');
$line = fgets($fd);
pclose($fd);
return trim($line);
}