holinhot
V2EX  ›  问与答

php 怎么获取根域名

  •  
  •   holinhot · Oct 31, 2015 · 2352 views
    This topic created in 4032 days ago, the information mentioned may be changed or developed.

    像什么
    ljfaosfu.qq.com
    img.wx.qq.om
    img.mail.qq.com
    cache.img.wx.qq.com
    www.google.co.jp
    www.google.jp
    www.gov.cn
    gz.gov.cn
    www.gz.gov.cn

    xx19941215
    xx19941215
    Oct 31, 2015
    1
    $_SERVER
    GPU
    GPU
    Oct 31, 2015
    2
    我在 python 是非常粗暴的获取倒数第二个句号开始 之后的。
    xfspace
    xfspace
    Oct 31, 2015
    3
    自己的服务器, http://php.net/reserved.variables.server
    别人的服务器,用正则?
    holinhot
    holinhot
    OP
    Oct 31, 2015
    4
    @GPU 这个不行吧

    @xfspace
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   1764 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 46ms · UTC 01:03 · PVG 09:03 · LAX 17:03 · JFK 20:03
    ♥ Do have faith in what you're doing.