How does PHP use require ?? Is there a function in an external file ??

Source: Internet
Author: User
In an external file demo1.php, there is a function test and an echo '000000'; in the other file demo2.php, require 'demo1. php'; echo '000000'; why is the following content not displayed in the industry after I call test () in demo2? 1111111 do not show do not call... an external file demo1.php has a function test and an echo '123 ';
In another file demo2.php, require 'demo1. php'; echo '123 ';
Why is the following content not displayed in the industry after I call test () in demo2? 1111111 not displayed
No call, normal

Reply content:

In an external file demo1.php, there is a function test and an echo '123 ';
In another file demo2.php, require 'demo1. php'; echo '123 ';
Why is the following content not displayed in the industry after I call test () in demo2? 1111111 not displayed
No call, normal

1 show me the code!

2. Debug php errors. some errors may occur. The error Log is displayed.

How can I load require 'demo1. php' in a different folder?

There may be errors in demo1, or demo1 does not exist.
It may also be your single quotes and semicolons.

It should have reported a Fatal error. you can open the error report.
Error_reporting (E_ALL );
Ini_set ('display _ errors ', 'on ')

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.