Difference between include() and require()

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
php_wiz_kid
Forum Contributor
Posts: 181
Joined: Tue Jun 24, 2003 7:33 pm

Difference between include() and require()

Post by php_wiz_kid »

What's the difference between include() and require()? Thanks.
Galahad
Forum Contributor
Posts: 111
Joined: Fri Jun 14, 2002 5:50 pm

Post by Galahad »

include() will just give a warning if the file can't be opened for some reason, but continue executing. require() will actually halt execution of the script. Here's the manual page. Look at the paragraph starting with " require() and include() are identical in every way except how they handle failure".
php_wiz_kid
Forum Contributor
Posts: 181
Joined: Tue Jun 24, 2003 7:33 pm

Post by php_wiz_kid »

Alright, thanks.
Post Reply