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

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

WBOY
Release: 2016-06-13 10:00:24
Original
900 people have browsed it

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

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

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

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template