摘要: php如何通过字符串获取域名URL地址例如:http://www.3ppt.com得到www.3ppt.comfunction get_domain($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" 阅读全文
posted @ 2011-07-20 10:55 Mcc_5011 阅读(659) 评论(1) 推荐(0) 编辑