Today, we mainly introduce the application of file directory function in the development of PHP website. In the development of PHP website, we often need to read directory file information or create a directory to store the necessary files, and when
Analysis of the relationship between the absolute path and relative path of php. Php does not seem to use "" to represent the root directory as asp does. Instead, it uses $ _ SERVER [DOCUMENT_ROOT]. Others are the same:... to represent the upper
To describe the location of a file, you can use a summary path and a relative path. An absolute path is a first-level entry from the root to each subdirectory, and the file name or directory name is finally specified. The relative directory enters a
PHP Tutorial Configuration Chinese Narration
Let's see what you see, php.ini.
[PHP]
;;;;;;;;;;;; WARNING;;;;;;;;;;;;; This is the default settings file for new PHP installations.; By default, PHP installs itself with a configuration suitable for;
For example, just record the uncertain path contained in PHP:
This is caused by the include path of PHP. Test it by yourself and summarize it as follows.
DefinitionA = include file B = file included by a c = file included by B That is to say, a
In-depth study on the relationship between the absolute path and relative path in php, it seems that php cannot use "/" as asp does to represent the ROOT directory, replacing it with $ _ SERVER ['document _ root'], others are the same :.. /indicates
Php does not seem to use "/" as asp does to represent the root directory, replacing it with $ _ SERVER [
Php does not seem to use "/" as asp does to represent the ROOT directory, replacing it with $ _ SERVER ['document _ root']. Others are the same :
Use absolute and relative paths in php. Let's take a look at two pieces of code: Code 1: Access [php] metahttp-equivContent-Typecontenttexthtml; charsetGBK? Phpecho $ _ SERVER [DOCUMENT_ROOT];? The imgsrc..1.jpg code is as follows:
Code 1: access
In php, it seems that the root directory cannot be represented by "" like asp, and $ _ SERVER [in php does not seem to be represented by "/" like asp, replace it with $ _ SERVER ['document _ root']. the others are the same :.. /indicates the upper
PHP does not seem to use "/" as ASP does to represent the root directory, replacing it with $ _ server ['document _ root']. Others are the same :.. /indicates the upper layer .. /Indicates the current layer. If A/B/C/S. php needs to call/BB/s2.txt
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.