摘要:
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" 阅读全文