---
title: "PHP获取网卡MAC地址的方法"
author: "javaeyeren"
date: "2009-02-02T01:45:00Z"
tags: []
slug: "php-mac"
draft: false
lastmod: "2009-02-02T01:45:00Z"
id: 601347
url: "https://javaeyeren.iteye.com/blog/601347"
---

&lt;?php  
@exec("ipconfig /all",$array);  
for($Tmpa;$Tmpa&lt;count($array);$Tmpa++){  
if(eregi("Physical",$array\[$Tmpa])){  
$mac=explode(":",$array\[$Tmpa]);  
echo $mac\[1];  
}  
}  
?&gt;