PHP realpath (...)
Author: zfive5 (zidong)
Email: zfive5@yahoo.com.cn
Introduction:
Yesterday, I changed my PHP program. After I configured eclipse + PhP (xdebug) + MySQL + Apache, I got into a long and boring debugging step by step, although the tool is not very easy to use (but also excited about the progress in the PHP environment over the past nine years), throughout the debugging process, I found that I completely made realpath (...) it took more than an hour into the ditch! Something should be written for this hour!
Body:
PHP realpath () function
Definition and usage
The realpath () function returns the absolute path.
This function deletes all symbolic connections (such as '/./', '/./', and excess '/') and returns the absolute path name.
If it fails, false is returned. For example, the file does not exist.
Syntax
Readlink (linkpath)
Parameter description
Linkpath is required. Specifies the connection path to be checked.
Description
On the BSD system, if only linkpath does not exist, PHP does not return false as other systems do.
Directory structure:
Website
|
| -- 1.php
|
| -- Txt11
| -- 2.php
1. php:
<? PHP
Require ("./TXT/2.php ")
Output "1.php path:". realpath ("./"). "<br/> ";
?>
2. php:
<? PHP
Output "2.php path:". realpath ("./"). "<br/> ";
?>
Run the following command in the browser:
Http: // localhost: 8080/1. php
Http: // localhost: 8080/TXT/2.php
The file (2.php) introduced by require () is changed to a part of the PHP program web page (1.php,I personally feel that to avoid the uncertainty caused by mixed use of realpath and require, we recommend that you use $ _ serve ['document _ root']
A few days ago, I read a book "fall in love with Single Chip Microcomputer", and it's amazing!
Today, I borrowed two books in terms of "WCF" and "siliverlight" to continue ......
There are two books, "high-performance website construction Guide" and "advanced high-performance website construction Guide". They are definitely good books and concise and clear!
I feel that there are a lot of books in the bookstore. There is too much water to get started with this entry. There are only a few such books generated every year, and it must be one to 3.12 yuan.
Moving trees is much better.
Say: Hi, GY