Home  >  Article  >  Backend Development  >  如何让它自动找到浏览路径

如何让它自动找到浏览路径

WBOY
WBOYOriginal
2016-06-13 10:00:24776browse

怎么让它自动找到浏览路径?
//浏览路径
    $conf[ "Base_url "]   =   "http:// "   .   $_SERVER[ "SERVER_NAME "];
这个语句还不够智能
假如我放到子目录中去了又要改为:
//浏览路径
    $conf[ "Base_url "]   =   "http:// "   .   $_SERVER[ "SERVER_NAME "]   .   "/*** ";
有更好的办法么?

------解决方案--------------------
print_r($_SERVER)
自己找
------解决方案--------------------
直接写

$conf[ "Base_url "] = "/xxx ";
------解决方案--------------------
楼主到底想实现什么样的功能??

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn