ninedoors Posted April 1, 2008 Share Posted April 1, 2008 Hi, I am wondering what the best way is to include all the files I need to run a program. By the time I am done I will have probably 10 functions that I will be calling. Is there a way to include all those files simply by including their folder? Instead of have to include 10 files. Is that possible, seems like it should be. Thanks Nick Link to comment https://forums.phpfreaks.com/topic/98980-php-includes-question/ Share on other sites More sharing options...
p2grace Posted April 1, 2008 Share Posted April 1, 2008 Create a include file that does nothing but include the rest. Link to comment https://forums.phpfreaks.com/topic/98980-php-includes-question/#findComment-506462 Share on other sites More sharing options...
Xil3 Posted April 1, 2008 Share Posted April 1, 2008 Nope, but what you could do is have a separate file that holds all the includes and just include that one file instead of having to copy and paste all the 10+ includes in each file that requires it... Here is an example: Includefile.php include "file1.php"; include "file2.php"; include "file3.php"; ... Does that make sense? Link to comment https://forums.phpfreaks.com/topic/98980-php-includes-question/#findComment-506465 Share on other sites More sharing options...
ninedoors Posted April 1, 2008 Author Share Posted April 1, 2008 I tried something liek thsi to test is but it failed. <?php include 'functions/'; $sheet ='Excel/MC_BRAND_FORECAST.xls'; $brand = 'M5'; readexcel($brand, $sheet); ?> Where functions folder holds my functions. What did I do wrong? Link to comment https://forums.phpfreaks.com/topic/98980-php-includes-question/#findComment-506466 Share on other sites More sharing options...
ninedoors Posted April 1, 2008 Author Share Posted April 1, 2008 Yep that makes sense Xil3. I'll try that. Nick Link to comment https://forums.phpfreaks.com/topic/98980-php-includes-question/#findComment-506469 Share on other sites More sharing options...
Xil3 Posted April 1, 2008 Share Posted April 1, 2008 Alright, lemme know if you have any other issues with it. Link to comment https://forums.phpfreaks.com/topic/98980-php-includes-question/#findComment-506471 Share on other sites More sharing options...
ninedoors Posted April 1, 2008 Author Share Posted April 1, 2008 Will do. Link to comment https://forums.phpfreaks.com/topic/98980-php-includes-question/#findComment-506475 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.