function-includedirectory
Gesponsorde koppelingen
PHP script bestanden
Code (php)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
<?php
function include_directory($directory, array $exclude = array(), $subdirs=FALSE)
{
$dir = new DirectoryIterator($directory);
foreach( $dir as $child )
{
if( $child->isFile() )
{
if( ! in_array($child, $exclude) )
{
include($child->getPathname());
}
}
elseif( $subdirs )
{
include_directory($child, $exclude, $subdirs);
}
}
$dir=NULL;
}
?>
function include_directory($directory, array $exclude = array(), $subdirs=FALSE)
{
$dir = new DirectoryIterator($directory);
foreach( $dir as $child )
{
if( $child->isFile() )
{
if( ! in_array($child, $exclude) )
{
include($child->getPathname());
}
}
elseif( $subdirs )
{
include_directory($child, $exclude, $subdirs);
}
}
$dir=NULL;
}
?>