惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

C
CXSECURITY Database RSS Feed - CXSecurity.com
Stack Overflow Blog
Stack Overflow Blog
月光博客
月光博客
T
Threat Research - Cisco Blogs
小众软件
小众软件
有赞技术团队
有赞技术团队
酷 壳 – CoolShell
酷 壳 – CoolShell
Apple Machine Learning Research
Apple Machine Learning Research
C
Cyber Attacks, Cyber Crime and Cyber Security
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
T
Tailwind CSS Blog
Cisco Talos Blog
Cisco Talos Blog
V
V2EX
博客园 - 【当耐特】
C
Cybersecurity and Infrastructure Security Agency CISA
Hugging Face - Blog
Hugging Face - Blog
The Cloudflare Blog
The Last Watchdog
The Last Watchdog
Simon Willison's Weblog
Simon Willison's Weblog
T
Threatpost
S
Secure Thoughts
O
OpenAI News
P
Proofpoint News Feed
S
SegmentFault 最新的问题
Forbes - Security
Forbes - Security
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
Application and Cybersecurity Blog
Application and Cybersecurity Blog
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
Last Week in AI
Last Week in AI
宝玉的分享
宝玉的分享
Scott Helme
Scott Helme
T
Tenable Blog
A
Arctic Wolf
L
LINUX DO - 热门话题
爱范儿
爱范儿
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
www.infosecurity-magazine.com
www.infosecurity-magazine.com
V
Visual Studio Blog
Hacker News: Ask HN
Hacker News: Ask HN
Hacker News - Newest:
Hacker News - Newest: "LLM"
腾讯CDC
博客园 - Franky
WordPress大学
WordPress大学
Know Your Adversary
Know Your Adversary
博客园_首页
雷峰网
雷峰网
IT之家
IT之家
PCI Perspectives
PCI Perspectives
L
LINUX DO - 最新话题
H
Heimdal Security Blog

博客园 - 古代

linux下关于重命名卷标 wget header参数使用。 - 古代 - 博客园 奔波尔霸温瑞安 方娥真〈月台〉析论 入凡尘十二年的方娥真 模拟兼容onmouseleave,onmouseenter - 古代 - 博客园 python 进程通信测试代码(程序A,程序B) parse_url 和再pathinfo,what you'll get - 古代 autopos php转换拼音,全。 RPM 安装mod_encoding,linux下apache支持中文名 自动杀死pps的后台进程 js表达式转义 - 古代 - 博客园 批量jstest rm大量文件 Read-only file system处理记录 通过PHP获取生僻字的汉语拼音[转] 唉,这个备案,头疼. 神奇的js代码,图片全都飞起来了
get_top_dom($dom); - 古代 - 博客园
古代 · 2009-11-26 · via 博客园 - 古代

$dom = "2.dd.com.cn";
$dom = "2.dd.net.cn";
$dom = "2.dd.cn";
$dom = "2.dd.com";
$dom = "http://finance.qq.com/a/20091126/005836.htm";


echo get_top_dom($dom);

function get_top_dom($dom)
{
 $gendom_arr = array( "com.cn" , "net.cn" , "org.cn" , "co.jp" , "co.kr" , "com.hk" , "com.tw" );
 $dom =  str_replace("http://","",$dom);
 $dom =  str_replace("ftp://","",$dom);
 $dom = preg_replace( "#/.*#i" , "" , $dom);
 $arr = explode(".",$dom);
 $len = count($arr);
 if($len>2)
 {
  $topdom = $arr[$len-2]. "." . $arr[$len-1];
  if(in_array($topdom,$gendom_arr))
  {
   $topdom = $arr[$len-3]. "." . $topdom;
  }
  return $topdom;
 }
 else
 {
     return $dom;
 }
}