<?xml version="1.0" encoding="UTF-8" ?>
<rss version="2.0">
<channel>
<title><![CDATA[沧海一粟]]></title> 
<link>http://www.dzhope.com/index.php</link> 
<description><![CDATA[Web系统架构与服务器运维,php开发]]></description> 
<language>zh-cn</language> 
<copyright><![CDATA[沧海一粟]]></copyright>
<item>
<link>http://www.dzhope.com/post//</link>
<title><![CDATA[php程序获取客户端MAC地址]]></title> 
<author>jed &lt;jed521@163.com&gt;</author>
<category><![CDATA[代码编程]]></category>
<pubDate>Wed, 14 Mar 2018 02:12:41 +0000</pubDate> 
<guid>http://www.dzhope.com/post//</guid> 
<description>
<![CDATA[ 
	<div class="code"><br/>&lt;?php<br/>class GetMacAddr&#123;<br/>var $return_array = array(); // <br/>var $mac_addr;<br/>function GetMacAddr($os_type)&#123;<br/>switch ( strtolower($os_type) )&#123;<br/>case &quot;linux&quot;:<br/>$this-&gt;forLinux();<br/>break;<br/>case &quot;solaris&quot;:<br/>break;<br/>case &quot;unix&quot;:<br/>break;<br/>case &quot;aix&quot;:<br/>break;<br/>default:<br/>$this-&gt;forWindows();<br/>break;<br/>&#125;<br/>$temp_array = array();<br/>foreach ( $this-&gt;return_array as $value )&#123;<br/>if (<br/>preg_match(&quot;/&#91;0-9a-f&#93;&#91;0-9a-f&#93;&#91;:-&#93;&quot;.&quot;&#91;0-9a-f&#93;&#91;0-9a-f&#93;&#91;:-&#93;&quot;.&quot;&#91;0-9a-f&#93;&#91;0-9a-f&#93;&#91;:-&#93;&quot;.&quot;&#91;0-9a-f&#93;&#91;0-9a-f&#93;&#91;:-&#93;&quot;.&quot;&#91;0-9a-f&#93;&#91;0-9a-f&#93;&#91;:-&#93;&quot;.&quot;&#91;0-9a-f&#93;&#91;0-9a-f&#93;/i&quot;,$value,<br/>$temp_array ) )&#123;<br/>$this-&gt;mac_addr = $temp_array&#91;0&#93;;<br/>break;<br/>&#125;<br/>&#125;<br/>unset($temp_array);<br/>return $this-&gt;mac_addr;<br/>&#125;<br/>function forWindows()&#123;<br/>@exec(&quot;ipconfig /all&quot;, $this-&gt;return_array);<br/>if ( $this-&gt;return_array )<br/>return $this-&gt;return_array;<br/>else&#123;<br/>$ipconfig = $_SERVER&#91;&quot;WINDIR&quot;&#93;.&quot;&#92;system32&#92;ipconfig.exe&quot;;<br/>if ( is_file($ipconfig) )<br/>@exec($ipconfig.&quot; /all&quot;, $this-&gt;return_array);<br/>else<br/>@exec($_SERVER&#91;&quot;WINDIR&quot;&#93;.&quot;&#92;system&#92;ipconfig.exe /all&quot;, $this-&gt;return_array);<br/>return $this-&gt;return_array;<br/>&#125;<br/>&#125;<br/>function forLinux()&#123;<br/>@exec(&quot;ifconfig -a&quot;, $this-&gt;return_array);<br/>return $this-&gt;return_array;<br/>&#125;<br/>&#125;<br/>//·½·¨Ê¹ÓÃ<br/>$mac = new GetMacAddr(PHP_OS);<br/>echo $mac-&gt;mac_addr;<br/>?&gt;<br/></div>
]]>
</description>
</item><item>
<link>http://www.dzhope.com/post//#blogcomment</link>
<title><![CDATA[[评论] php程序获取客户端MAC地址]]></title> 
<author> &lt;user@domain.com&gt;</author>
<category><![CDATA[评论]]></category>
<pubDate>Thu, 01 Jan 1970 00:00:00 +0000</pubDate> 
<guid>http://www.dzhope.com/post//#blogcomment</guid> 
<description>
<![CDATA[ 
	
]]>
</description>
</item>
</channel>
</rss>