the include and require functions:
The include and require functions take the path to a file. The file is parsed as if it were a standalone PHP script. This is similar to the include directive in C and the require directive in perl. There is a subtle difference between the two functions.
When the require function is processed, it its replaced with the file it points to,. The include function acts more like a function call.
The difference is most dramatic inside a loop. Imagine having three files you wanted to execute one after the other. You could put an include inside a for loop, and if the files were named something like include1.php, include2.php and include2php you would have no problem. You could just build the name based on counter variable.
If you used require, however, you would executed the first file three items. That’s because on the first time through the loop, the call to require would be replaced with the contents of the file. As I said, the difference is subtle but can be very dramatic. difrence
What Is The Difference Between Include And Require Functions In Php Diference
What Is The Difference Between Include And Require Functions In Php Diference
What Is The Difference Between Include And Require Functions In Php Diference
Post Description:
Post Tags: what, is, the, difference, between, include, and, require, functions, in, php, diference
This Post Has Been Viewed 230 Times Since Sun May 06, 2007 9:24 pm Posted By lini with 0 replies
Post Description:
Post Tags: what, is, the, difference, between, include, and, require, functions, in, php, diference
This Post Has Been Viewed 230 Times Since Sun May 06, 2007 9:24 pm Posted By lini with 0 replies
| What Is The Difference Between Include And Require Functions In Php Diference |
Leave Your Comments [ dejar commentarios ]
Comments and replies About What Is The Difference Between Include And Require Functions In Php Diference
(0) Comments

