Phpdirname _ FILE _ example tutorial-PHP source code

Source: Internet
Author: User
Ec (2); phpdirname _ FILE __& nbsp; & nbsp; dirname (_ FILE _) is the directory where the current FILE is located, is to return the path of the actual FILE to see several instances * Direct _ FILE _ viewing instance $ url _ FILE __; echo $ url; the result is D: wwwfkt. php let's take a look at _ FILE _ with dirname using $ urld script ec (2); script

Php dirname _ FILE __

Dirname (_ FILE _) is the directory where the current FILE is located. It is the path where the actual FILE is returned. Let's look at several instances.
*/

// View the instance directly _ FILE _
$ Url = _ FILE __;

Echo $ url;

// The result is
// D: wwwfkt. php

// Let's take a look at _ FILE _ in combination with dirname.

$ Url = dirname (_ FILE __);
Echo $ url;

// Result

// D: wwwfk

// View other realpaths
Echo realpath ($ url );

// Result
// D: wwwfk

Die ();

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.