Difference between include_once and include

+1 Roopavathy Baskaran · February 4, 2015
Hi,

I want to know the difference include_once and include.Similarly for require &  require_once.Can you please exlpain me with some example?
Please...

Thanks in advance.

Post a Reply

Replies

Oldest  Newest  Rating
0 ludwig fourie · February 5, 2015
There is no real difference. The main difference is between include and require. Include and require does the same thing, but when a error occurs, include with only generate a warning where require will give a fatal error.

The difference between include and include_once is, when a file was included before include_ones won't include it again, but if u used include it will included it again.

Hope this helps 
0 Roopavathy Baskaran · February 12, 2015
Thanks a lot every one.
0 Michael Chimezie · February 28, 2015
you could as well read http://tutorialslodge.com/php-file-inclusion/ for better understanding
0 Roopavathy Baskaran · March 3, 2015
Thanks Michael....Very Useful.....:)
0 Michael Chimezie · March 3, 2015
Roopavathy glad it was helpful
  • 1

PHP

107,006 followers
About

Server-side, HTML embedded scripting language used to create dynamic Web pages.

Links
Moderators