I have this function defined in a FileA.php
function readDirectory($aPath) {
$list = Array();
if(is_dir($aPath)) {
if ($dh = opendir($aPath)) {
while (($file = readdir($dh)) !== false) {
if(is_file("$aPath/$file") && $file != '.htaccess') {
$list[$file] = "$file";
}
}
closedir($dh);
}
}
sort($list, SORT_STRING);
return $list;
}
And I got FileA.php included()
in FileB.php and then FileB.php included()
in the FileC.php I want
to execute. But I get:
Fatal error: Call to undefined function readDirectory() in ..folder/FileC.php on line 2
Can't figure out what's wrong.