holinhot
V2EX  ›  问与答

php 怎么获取根域名

  •  
  •   holinhot · Oct 31, 2015 · 2194 views
    This topic created in 3872 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
        1
    xx19941215  
       Oct 31, 2015
    $_SERVER
    GPU
        2
    GPU  
       Oct 31, 2015
    我在 python 是非常粗暴的获取倒数第二个句号开始 之后的。
    xfspace
        3
    xfspace  
       Oct 31, 2015
    自己的服务器, http://php.net/reserved.variables.server
    别人的服务器,用正则?
    holinhot
        4
    holinhot  
    OP
       Oct 31, 2015
    @GPU 这个不行吧

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