Created
May 11, 2009 21:46
-
-
Save domenicomonaco/110205 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
//simple example of recursive require and read *.ext of files | |
$dir = "./path_file/"; //Set dir | |
$dh = opendir($dir); | |
while (($file = readdir($dh)) !== false) { | |
$fExt= end(explode(".", $file)); | |
if ($fExt=='php'){ //if ext of file is php or other *.ext | |
$rFile[]=$file; //add file to array | |
} | |
} | |
closedir($dh); | |
// recursive inlcuding of file of array | |
for ($d=0;$d<$dmax=(sizeof($rFile));$d++){ | |
require ($dir.$rFile[$d]); | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment