Home  >  Article  >  What is the difference between relative path and absolute path

What is the difference between relative path and absolute path

王林
王林Original
2020-05-10 10:28:3318019browse

What is the difference between relative path and absolute path

Absolute path:

The absolute path is the real path of the file or directory on your home page on the hard disk, (URL and physical path )For example: C:\xyz\test.txt represents the absolute path of the test.txt file. http://www.sun.com/index.htm also represents an absolute URL path.

Relative path:

The path relative to a certain base directory. Contains the relative path of the Web (relative directory in HTML). For example: in Servlet, "/" represents the root directory of the Web application. Relative representation of physical path, for example: "./" represents the current directory, "../" represents the upper-level directory. This similar representation also belongs to relative path.

The above is the detailed content of What is the difference between relative path and absolute path. For more information, please follow other related articles on the PHP Chinese website!

Statement:
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