EchoFool Posted May 18, 2008 Share Posted May 18, 2008 If you have an include that is on nearly every page... can the include_once be used? I ain't entirely sure what it means. but doesn't it mean it will be included on every page rather than having to tell it to include it on every page? :S Link to comment https://forums.phpfreaks.com/topic/106226-global-includes/ Share on other sites More sharing options...
Symmetry Posted May 18, 2008 Share Posted May 18, 2008 With every page you will need to use the include or include_once function... the difference is, with include_once it'll only be included one time and then no more (I believe).. so if you have say- a foreach() loop, the first time it loops it'll include the file but it wont include it again and again each time it passes. Link to comment https://forums.phpfreaks.com/topic/106226-global-includes/#findComment-544505 Share on other sites More sharing options...
DarkWater Posted May 19, 2008 Share Posted May 19, 2008 No, that's not what include_once does (@EchoFool). Symmetry had it right. What you SHOULD do is make like a file named "universal.php" and put every include that you need in there, then just include universal.php in each file. Link to comment https://forums.phpfreaks.com/topic/106226-global-includes/#findComment-544540 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.