PHP realpath (...)

Source: Internet
Author: User

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

 

 

Contact Us

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.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.