PHP中获得mac地址
来源:互联网 发布:网络象棋 编辑:程序博客网 时间:2024/06/05 18:33
<?phpclass GetMacAddr {var $return_array = array();// 返回带有MAC地址的字串数组var $mac_addr = array();function GetMacAddr() {switch (strtolower(PHP_OS) ) {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) {if (preg_match("/[0-9a-f][0-9a-f][:-]" . "[0-9a-f][0-9a-f][:-]" . "[0-9a-f][0-9a-f][:-]" . "[0-9a-f][0-9a-f][:-]" . "[0-9a-f][0-9a-f][:-]" . "[0-9a-f][0-9a-f]/i", $value, $temp_array)) {$this -> mac_addr[] = $temp_array[0];}}unset($temp_array);return $this -> mac_addr;}function forWindows() {@exec("ipconfig /all", $this -> return_array);if ($this -> return_array)return $this -> return_array;else {$ipconfig = $_SERVER["WINDIR"] . "\system32\ipconfig.exe";if (is_file($ipconfig))@exec($ipconfig . " /all", $this -> return_array);else@exec($_SERVER["WINDIR"] . "\system\ipconfig.exe /all", $this -> return_array);return $this -> return_array;}}function forLinux() {@exec("ifconfig -a", $this -> return_array);return $this -> return_array;}}$mac = new GetMacAddr();//var_dump($mac);print_r($mac -> mac_addr);
0 0
- PHP中获得mac地址
- php获得mac地址
- PHP如何获得电脑的MAC地址!
- PHP 获得计算机的唯一标识[CPU,网卡 MAC地址]
- 获得网卡MAC地址
- Java 获得MAC地址
- :获得mac地址
- 获得Mac的地址
- 获得网卡MAC地址
- C#获得mac地址
- java获得MAC地址
- iPhone 获得Mac地址
- 获得网卡MAC地址 .
- 获得网卡MAC地址
- 获得MAC地址
- Qt中获得IP、MAC地址、用户名、机器名
- php获得ip地址
- php 获得ip地址
- Android项目的目录结构
- DataMining(2)_Mining Frequent Patterns
- 蛤玮准备礼物
- Spring学习笔记4-AOP
- 专题三 第一题
- PHP中获得mac地址
- MSSQL如何在没有主键的表中删除重复数据
- 常用的adb指令
- Android混淆APK直接copy使用
- 杭电ACM---1002(大数)
- 平衡二叉树-Java
- AndroidStudio 删除依赖的 Android Library Module
- 解决WideCharToMultiByte结尾乱码问题
- iOS- UI控件常见属性总结