Home > Backend Development > PHP Tutorial > How to use require in PHP? ? Can't there be functions in external files? ?

How to use require in PHP? ? Can't there be functions in external files? ?

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-08-18 09:16:35
Original
1616 people have browsed it

There is a function test in an external file demo1.php and an echo '000000';
require 'demo1.php' in another file demo2.php; echo '1111111';
Why do I call test in demo2 ( ), the following content within this field is not displayed? 1111111 is not displayed
not called, normal

Reply content:

There is a function test in an external file demo1.php and an echo '000000';
require 'demo1.php' in another file demo2.php; echo '1111111';
Why do I call test in demo2 ( ), the following content within this field is not displayed? 1111111 is not displayed
not called, normal

1 show me the code!

2 Turn on php error debugging. This should indicate that some error has occurred. You will know after typing out the error log.

How can the require 'demo1.php' be loaded if it is not in the same folder? The path must be written correctly

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

It should be a Fatal error. You can turn on error reporting
error_reporting(E_ALL);
ini_set('display_errors', 'On')

Related labels:
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Issues
php data acquisition?
From 1970-01-01 08:00:00
0
0
0
PHP extension intl
From 1970-01-01 08:00:00
0
0
0
How to learn php well
From 1970-01-01 08:00:00
0
0
0
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template