Difference between include and include_once? | Sololearn: Learn to code for FREE!
¡Nuevo curso! ¡Todo programador debería aprender IA Generativa!
Prueba una lección gratuita
+ 1

Difference between include and include_once?

PHP include statement

2nd May 2017, 2:23 AM
vignesh shenoy
vignesh shenoy - avatar
2 Respuestas
+ 1
Include_once will include file at once, that means if it is already loaded it will not load again.
2nd May 2017, 2:45 AM
Aditya kumar pandey
Aditya kumar pandey - avatar
+ 1
In PHP you cannot declare same function more than one time so if you accidentally include already included file with declared functions you will get an error. include_once save you from such problems.
2nd May 2017, 3:49 AM
Jeth
Jeth - avatar