<?php
//获取网卡MAC地址
@exec("ipconfig/all",$array);
for($Tmpa;$Tmpa<count($array);$Tmpa++){
if(eregi("Physical",$array[$Tmpa])){
$mac=explode(":",$array[$Tmpa]);
echo $mac[1];
}
}
//获取url主域
//by http://www.jb200.com
function GetDomain($url){
$pattern = "/[w-]+.(com|net|org|gov|cc|biz|info|cn)(.(cn|hk))*/";
preg_match($pattern, $url, $matches);
if(count($matches) > 0){
return $matches[0];
}else{
$rs = parse_url($url);
$main_url = $rs["host"];
if(!strcmp(long2ip(sprintf("%u",ip2long($main_url))),$main_url)) {
return $main_url;
}else{
$arr = explode(".",$main_url);
$count=count($arr);
$endArr = array("com","net","org","3322");//com.cn net.cn 等情况
if(in_array($arr[$count-2],$endArr)){
$domain = $arr[$count-3].".".$arr[$count-2].".".$arr[$count-1];
}else{
$domain = $arr[$count-2].".".$arr[$count-1];
}
return $domain;
}//end if(strcmp)
}//end if(count)
}//end fun
?>
您可能感兴趣的文章:
PHP获取MAC地址的实现代码
php获取电脑MAC地址
php取客户端MAC地址
php获取计算机唯一标识信息 cpu,网卡,MAC地址
什么是MAC地址-基础知识