一、php
//网址
$att='http://www.baidu.com/index/index.html';
$url=parse_url ($att);
$url=$url['host'];//获取域名
dump($url);
二、页面显示
![](https://i-blog.csdnimg.cn/blog_migrate/98fba570948c17d0cc3348507b5d0b45.png)
一、php
//网址
$att='http://www.baidu.com/index/index.html';
$url=parse_url ($att);
$url=$url['host'];//获取域名
dump($url);
二、页面显示