: This article mainly introduces the php-file path problem. if you are interested in the PHP Tutorial, refer to it. 1. Background
Today, when I was developing a sample website, I encountered a troublesome problem, that is, the file path of Php, which is very tangled. after that, I checked the relevant information and obtained some knowledge!
2. example
(1) the Url for this test is as follows: the getallifo. php file in the app folder
Http: /localhost: 8081/GoodsServers/app/getAllIfo. php
(2) test results
$ Pa = $ _ SERVER ['document _ root']; echo $ pa; # D:/Wamp/wamp/www/echo'
'; Echo _ FILE __; # D: \ Wamp \ wamp \ www \ GoodsServers \ app \ getAllIfo. phpecho'
'; Echo dirname (_ FILE _); # D: \ Wamp \ wamp \ www \ GoodsServers \ appecho'
'; Echo dirname (_ FILE _); # D: \ Wamp \ wamp \ www \ GoodsServersecho'
'; Echo basename (_ FILE _); # getAllIfo. phpExit;
Copyright Disclaimer: This article is an original article by the blogger and cannot be reproduced without the permission of the blogger.
The above introduces the php-file path problem, including the content, and hope to be helpful to friends who are interested in the PHP Tutorial.