exec(‘/sbin/arp -a 2>&1‘, $array, $return_val);dump($array);$mac = ‘‘;foreach($array as $value){//匹配结果放到数组$mac_array if(strpos($value,$_SERVER["REMOTE_ADDR"]) && preg_match("/(:?[0-9A-F]{2}[:-]){5}[0-9A-F]{2}/i",$value,$mac_array)){ $mac = $mac_array[0]; break; }}echo $mac;
原文地址:https://www.cnblogs.com/php-linux/p/8341016.html
时间: 2024-11-07 06:00:51