$ipAddress=$_SERVER['REMOTE_ADDR']; $macAddr=false; #run the external command, break output into lines $arp=`arp -a $ipAddress`; $lines=explode("\n", $arp); #look for the output line describing our IP address foreach($lines as $line) { $cols=preg_split('/\s+/', trim($line)); if ($col[0]==$ipAddress) { $macAddr=$col[1]; } }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)