Recently I changed the OS for my machine from Windows to Linux but now my PHP application doesn't seem to run the opendir()
function within the new machine. Below is my code:
public function scandirs($dir){
$listDir = array();
if($handler = @opendir($dir)) {
while (($sub = readdir($handler)) !== FALSE) {
if ($sub != "." && $sub != ".." && $sub != "Thumb.db") {
if(is_file($dir."/".$sub)) {
$listDir[] = $dir.'\\'.$sub;
}
elseif(is_dir($dir."/".$sub)){
$listDir[$sub] = scandirs($dir."\\".$sub);
}
}
}
closedir($handler);
}
return $listDir;
}
If I perform a var_dump(opendir($dir));
it just returns a false.
EDIT
I need to add that I am running the files from the Linux Terminal.