How do I use absolute paths when using php paths?

Source: Internet
Author: User
For example, if the server is in & #039; C: AppServwww & #039; 01. php In & #039; C: AppServwwwYB-PHPPathDemoChina01.php & #039; is such as 01. php loads 02.php in the same directory and can write: {code ...} but how can I directly write an absolute path on the local machine? This is the case: {code...} I tried... for example, the server is in 'C: AppServwww ';

01. php In 'C: AppServwwwYB-PHPPathDemoChina01.php ';

For example, 01.php loads 02.php in the same directory,
Writability:

include('./02.php');include('/02.php');include('02.php');

But how can I directly write an absolute path on the local machine?
This is the case:

include('http://localhost/YB-PHP/PathDemo/China/02.php');

I tried it but I couldn't.

Reply content:

For example, the server is in 'C: AppServwww ';

01. php In 'C: AppServwwwYB-PHPPathDemoChina01.php ';

For example, 01.php loads 02.php in the same directory,
Writability:

include('./02.php');include('/02.php');include('02.php');

But how can I directly write an absolute path on the local machine?
This is the case:

include('http://localhost/YB-PHP/PathDemo/China/02.php');

I tried it but I couldn't.

An absolute path is a local path, not a network path.
For your file:
C:\\AppServ\www\YB-PHP\PathDemo\China\01.php

You must use http instead of http.

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.