天天看點

php 擷取目前域名和路徑

   $_SERVER['REQUEST_URI'];//擷取目前域名的字尾

    $_SERVER['HTTP_HOST'];//擷取目前域名

    dirname(__FILE__);//擷取目前檔案的實體路徑

    dirname(__FILE__)."/../";//擷取目前檔案的上一級實體路徑

php