PHP options and Information function library: get_required_files

Source: Internet
Author: User
Keywords get_required_files php option php Chinese function manual information function library
Tags aliyun array file files function function library get_required_files html

Get_required_files

(PHP4 >= 4.0rc2)

Get_required_files---&http://www.aliyun.com/zixun/aggregation/37954.html ">nbsp; Returns the name of the require_once () file in the program

Syntax: array get_required_files (void)

Description:

This function returns the name of all files that are loaded into the program using require_once (), which returns a combined array whose index value is the name of the file that is used in require_once () without the ". PHP".

Example:

<?php

Require_once ("local.php");

Require_once (". /inc/global.php ");

For ($i =1 $i <5; $i + +)

Include "Util". $i. " PHP ";

echo "Required_once files\n";

Print_r (Get_required_files ());

echo "Included_once files\n";

Print_r (Get_included_files ());

?>

This produces the following output:

required_once files

Array

(

[Local] => local.php

[.. /inc/global] =>/full/path/to/inc/global.php

)

included_once files

Array

(

[Util1] => util1.php

[Util2] => util2.php

[Util3] => util3.php

[Util4] => util4.php

)

Note: In PHP 4.0.1pl2, this function assumes that the Required_once file is the result of an expanded ". php", and that other extensions will not work.

Reference: require_once () include_once () Get_included_files ()

Related Article

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.