How can I check a dir like with the is_dir function and open it with the opendir function?
I have tried it but it doesn't work.
Do i need to take notice of something when I try to check and open an url.
Thanks!
My code
$handle = @opendir($dir);
while( $file = readdir($handle) ) {
if( is_dir("$dir/$file") )
$folders[] = $file;
elseif( is_file("$dir/$file") )
$files[] = $file;
}
@closedir($handle);
I have tried it but it doesn't work.
Do i need to take notice of something when I try to check and open an url.
Thanks!
My code
$handle = @opendir($dir);
while( $file = readdir($handle) ) {
if( is_dir("$dir/$file") )
$folders[] = $file;
elseif( is_file("$dir/$file") )
$files[] = $file;
}
@closedir($handle);