Alt-PHP-Faq

Vitamin Supplements| Cortavet| Cortaflex| Cortaflex| regtool| Esup| Zygor Guides| Equine Supplements| Manuka Honey| Fat Loss 4 Idiots| Zygor Guides| Download


Question :

Whats the difference between include() and require()?

Answer :
Qouted from the php manual:

Unlike include(), require() will always read in the target file, even if the line it's on never executes. If you want to conditionally include a file, use include(). The conditional statement won't affect the require(). However, if the line on which the require() occurs is not executed, neither will any of the code in the target file be executed.

In PHP 3, it is possible to execute a return statement inside a require()ed file, as long as that statement occurs in the global scope of the require()ed file. It may not occur within any block (meaning inside braces ({}). In PHP 4, however, this ability has been discontinued. If you need this functionality, see include().

Categories Return to Main PHP Faq

General


 

Questions

General
How do I run a php script from the command line?
What does PHP stand for?
How can I set the include path and other settings that are fixed in php.ini without having access to php.ini?
Can I connect to a Microsoft Access database without a DSN?
Can I get the screen resolution and like with php?
How can I convert a Access database to a MySQL database?
How do I get the visitors browser information?
I am totally new to PHP / MySQL / Programming in General. Where is a good place to start learning?
What is PEAR?
How do I send mails with PHP?
Are there any good PHP development environments / editors for Windows?
Can I use php with cron on unix systems?
Can php and flash work together?
How can I develop my own PHP extension ?
Are there any good PHP development environments / editors for Linux?
Using Apache can I get php to parse files not ending in .php?
How do I find out how a user came to my page?
How do I get started to use php?
Why doesn't rand give random numbers?
Have you read this article, "Student Suspended Over Suspected Use of PHP"?
How can I send large amounts of emails with php?
Why do I get "Warning: open(/tmp\sess_03416739e8d8712a1489aa6bb6bdf19d, O_RDWR)" failed ?
Where can I get a php mode for emacs?
Why do i get the error "Cannot add header information" ?
What does it mean when there is a & infront of a variable?
How do I turn newlines / returns into html breaks (<br>)?
I get an error 'PDF_set_info' must not be called in 'object' scope in script.php on line xxx
Where can I get a copy of PHP?
How do I find out what mode to use when creating dirs with mkdir
I am using PHP with SQL - can I ask a question in alt.php?
Who do I contact to add to this faq?
How can I redirect all http (non-secure port 80) requests to https (Secure port 443)
Since moving hosts my file permissions are wrong, how can I fix this?
 

Return to the main FAQ list




   
Design & Layout Copyright © 2000- 2008 PHP MySQL Web Hosting Comments to Webmaster
Hosted by PHP 4 Hosting - PHP and MySQL Webhosting and Domain Names