Jump to content

PHP includes question


ninedoors

Recommended Posts

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
Share on other sites

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
Share on other sites

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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.