Phpinclude () simple example of calling a file _ PHP Tutorial-php Tutorial

Source: Internet
Author: User
Phpinclude () calls a simple instance of a file. Includeinclude. php Tutorial; reference include. php file echoa (); result bb? The include. php file is as follows? Php creates include. php for other files to call functiona () definition function a {include 'include. php Tutorial '; // reference the include. php file

Echo ();

// Result bb
?>

The include. php file is as follows:

// Create include. php for calling other files
Function a () // defines function
{
B (); // call function B in function
}
Function B () // defines function B
{
C (); // call function c in function B
}
Function c () // define function c
{
Echo ('BB'); // output a php backtrace
}
A (); // use function
?>
Other tips:

When you use the require () statement to call a file, if the file is not found, The require () statement will output an error message and immediately terminate the script processing. when the include () statement does not find a file, it will output a warning and will not terminate the processing of the script.

Http://www.bkjia.com/PHPjc/632340.htmlwww.bkjia.comtruehttp://www.bkjia.com/PHPjc/632340.htmlTechArticleinclude 'include. php Tutorial '; // Reference include. php file echo a (); // result bb? The include. php file is as follows? Php // Create include. php for other files to call function a () // define function {...

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.