Welcome to REQUIRE_ONCE implementing by EDUCBA Website! This content is from the Menu1 PHP File :: This content is from the Header1 PHP File :: This is the require_once PHP program which is implemented using the REQUIRE_ONCE STATEMENT Sake Pavan Kumar PHP DOC for EDUCBA - Implementing require_once() function Check out the output below so that you will understand better. PHP file which is used for including has only some string text printed with the help of the echo statement just to know how the require_once() function is working. Then require_once() function is used for header1.php file, menu1.php file, footer1.file twice but the code will be implemented only once because of the require_once() functionality. Here some string text is entered just for the display purpose inside of the paragraph “” tags and in some other tags. This is an example of implementing the require_once() function in PHP. Examplesīelow are the examples to implement the same: Example #1 It is a very useful statement of the PHP Programming Language. If already included then the require_once function will leave including same. This require_once concept works only for PHP 4, PHP 5, PHP 7 versions and may be for PHP 7+ versions it will work. We can include a PHP script file/files as many times as we need but only once the specific PHP will be included and executed for the display of the output of the program. The require_once function of the PHP language works only once even though if we include a specific PHP file or files inside of the main PHP script file. Syntax: require_once(' PHP file with the path ') How require_once works in PHP?
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |