Get current domain

前端 未结 9 1587
时光取名叫无心
时光取名叫无心 2020-11-29 17:48

I have my site on the server http://www.myserver.uk.com.

On this server I have two domains:

one.com and two.com

I would l

9条回答
  •  慢半拍i
    慢半拍i (楼主)
    2020-11-29 18:00

    Try $_SERVER['SERVER_NAME'].

    Tips: Create a PHP file that calls the function phpinfo() and see the "PHP Variables" section. There are a bunch of useful variables we never think of there.

提交回复
热议问题