note 40625 added to function.readdir
| From: | Alan at rn2 dot php dot net | Date: | Wed, 10 Mar 2004 04:51:26 +0000 |
| Subject: | note 40625 added to function.readdir | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-66523@lists.php.net to get a copy of this message | ||
<?
#
#get_includes.php
#
#This trivial little thing reads in all the function files in functions.
#Well it will include anything ending in .php apart from itself, itself, itself, itself. . .
#
$dp = opendir("$DOCUMENT_ROOT/functions");
while ( false !== ($file = readdir($dp)))
{
if(preg_match("/.php$/", $file) and $file != "get_includes.php")
{
include $file;
}
}
?>
----
Manual Page -- http://www.php.net/manual/en/function.readdir.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+40625
Delete -- http://master.php.net/manage/user-notes.php?action=delete+40625&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+40625&report=yes
Search -- http://master.php.net/manage/user-notes.php