PHP怎么获取服务器的路径

PHPz
Release: 2020-09-04 18:00:54
Original
2679 people have browsed it

PHP获取服务器路径的步骤:首先打开php编辑器,新建php文件;然后输入代码“echo $_SERVER['DOCUMENT_ROOT'];”;最后运行该文件即可获取服务器路径信息。

PHP怎么获取服务器的路径

PHP怎么调用服务器的路径?php获得服务器的根目录

首先,打开php编辑器,再新建php文件,例如:index.php。

8fb21f80532cf84baace47b4050a8b2.png

在index.php中,输入:echo $_SERVER['DOCUMENT_ROOT'];。

6e4736e9efea37354d0bf29481f11f5.png

浏览器运行index.php页面,此时会打印出到服务器的根目录。

366c60009eb709c4bc22543ae79298d.png

更多相关知识,请访问PHP中文网

Related labels:
php
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