Inlcude files in a loop, with variable as file name?
Posted: Fri Nov 10, 2006 8:32 am
I'm a bit of a PHP noob. Been using it for about 9 months and still learning so sorry if this is stoopid 
my question is, is it possible to iterate over includes like in the below example
the reason i ask is that some code i'm working on needs profiles and i'd like to store them in separate files for easy maintanence. the thing is that more profiles could be added on an ad hoc basis as they are required and i don't want to have to edit the main code every time one is added.
thanks in advance for help/advice
my question is, is it possible to iterate over includes like in the below example
Code: Select all
for ($a = 0; $a < 10; $a++){
include_once("file$a.php");
}thanks in advance for help/advice