note 60531 added to function.include

From: Date: Tue, 10 Jan 2006 12:55:19 +0000
Subject: note 60531 added to function.include
Groups: php.notes 
Request: Send a blank email to php-notes+get-101486@lists.php.net to get a copy of this message
a simple function to recursively include e.g. the include-directory of your site and its subdirs: <?php function includeRecurse($dirName) { if(!is_dir($dirName)) return false; $dirHandle = opendir($dirName); while(false !== ($incFile = readdir($dirHandle))) { if($incFile != "." && $incFile != "..") { if(is_file("$dirName/$incFile")) include_once("$dirName/$incFile"); elseif(is_dir("$dirName/$incFile") includeRecurse("$dirName/$incFile"); } } closedir($dirHandle); } ?> ---- Manual Page -- http://www.php.net/manual/en/function.include.php Edit -- http://master.php.net/manage/user-notes.php?action=edit+60531 Delete: added to the manual -- http://master.php.net/manage/user-notes.php?action=delete+60531&report=yes&reason=added+to+the+manual Delete: bad code -- http://master.php.net/manage/user-notes.php?action=delete+60531&report=yes&reason=bad+code Delete: spam -- http://master.php.net/manage/user-notes.php?action=delete+60531&report=yes&reason=spam Delete: useless -- http://master.php.net/manage/user-notes.php?action=delete+60531&report=yes&reason=useless Delete: non-english -- http://master.php.net/manage/user-notes.php?action=delete+60531&report=yes&reason=non-english Delete: already in docs -- http://master.php.net/manage/user-notes.php?action=delete+60531&report=yes&reason=already+in+docs Delete: other reasons -- http://master.php.net/manage/user-notes.php?action=delete+60531&report=yes Reject -- http://master.php.net/manage/user-notes.php?action=reject+60531&report=yes Search -- http://master.php.net/manage/user-notes.php

« previous php.notes (#101486) next »