PHP dynamic file inclusion problems

Source: Internet
Author: User
The index. PHP content is as follows: PHPcode & lt ;? Phpfunctiona1 () {require_once_t.php;} b1 (); _ t. php file content: PHPcode & lt ;? Phpfunctionb1 () {echo & quot; dddddddd & quot ;}
The content of index. php is as follows:
PHP code
  

  

The content of the _ t. php file is as follows:
PHP code
  

  

In this way, an error will be reported. if you cannot find the b1 () function, how can we achieve this dynamic inclusion of a file? This file is a function extension library and can be used globally.

In the CodeIgniter framework, the Loader class dynamically loads libraries and class files. Why can it work?

------ Solution --------------------
B1 (); before, there must be a1 ();

------ Solution --------------------
.....
Of course you cannot find that you have not run a1 ();

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.