How to easily and effectively determine whether the URL is the homepage or the inner page? how to easily and effectively determine whether the URL is the homepage or the inner page
*. Com, www. *. com, or www. *. com/is the homepage.
*. Com/a or www. *. com/a.html or www. *. com/a/is the internal page.
My function is to display different links on the home page and on the internal page. I don't know if this idea is correct. or, let's take a look, if you want to do this (different links are displayed on the homepage and inner pages), what is the idea.
Thank you.
Reply to discussion (solution)
$ Url = 'http: // www.baidu.com/'{$arr=parse_url ($ url); if (str_replace ('/', '', $ arr ['path']) {echo 'not the homepage';} else {echo 'is the homepage ';}
Isn't a friend chain generally a primary domain name stored in the database?
$ Url = 'http: // www.baidu.com/a'?#arr=parse_url ($ url); if ($ arr ['path'] = '/') {echo 'is the homepage ';} else {echo 'not the homepage ';}
Not homepage
What if there are different friend links between pages?
The most fundamental solution is to define a name for each page or a group of pages in the same column. when adding a friend chain in the background, you can specify a name or all pages.
What if there are different friend links between pages?
The most fundamental solution is to define a name for each page or a group of pages in the same column. when adding a friend chain in the background, you can specify a name or all pages.
Thank you very much. Why didn't you think of this? haha, according to your ideas, you have done it. thank you.