Lets say I have a function, thats going to list everything in a directory. And say if its a directory or not...
soooo...
function grabDirectory($directory) {
if ($handle = opendir($directory)) {
while (false !== ($file = readdir($handle))) {
if ($file != "." && $file != "..") {
if(is_dir($file)) {
echo "$file is a directory<br>";
}
}
}
closedir($handle);
}
}
Will not work, nothing is a directory apparently, nothing is returned hehe.. So I put chdir($directory) inside of the function, and then called the function, it still did not work... hrmm how should I go about doing this?