$url='http://www.baidu.com/';
$arr=parse_url($url);
if(str_replace('/','',$arr['path'])){
echo '不是首页';
}else{
echo '是首页';
}