PHPBuilder - check dir then include the file



RSS Twitter
Tips Application Architecture

check dir then include the file

by: ayen
|
February 14, 2002

here some code that im using when there is to many include file...normaly i put this thing on index.php

 $dirlist = opendir("dirname");
            while($file=readdir($dirlist)) {
                  if(!ereg('^\.|html|LOG|test',$file))
                  {

                $mods = substr($file,0,strlen($file));

                  include($mods);
                  //echo $mods;
                  }
            }
closedir();
}
if(!ereg('^\.|html|LOG|test',$file)) this section handle the file that you dont want to include on it

Comment and Contribute

Your comment has been submitted and is pending approval.

Author:
ayen

Comment:



Comment:

(Maximum characters: 1200). You have characters left.