Home > php教程 > php手册 > php中定义网站根目录的常用方法

php中定义网站根目录的常用方法

WBOY
Release: 2016-06-06 20:34:54
Original
965 people have browsed it

php中一般需要定义网站的根目录,下面是常用的代码,需要朋友可以参考下。

复制代码 代码如下:


define('BASE_PATH',str_replace('\\','/',realpath(dirname(__FILE__).'/../')));

,美国服务器,香港服务器,美国服务器
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 Recommendations
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template