p5y Posted August 26, 2014 Share Posted August 26, 2014 if ($d = opendir("uploads")) { while ($file = readdir($d)) { if ($file != "." && $file != ".." ) // if( is_file($file) ) { $files[] = $file; } } closedir($d); } if ($file != "." && $file != ".." $file != ???????? ) just a bit stuck here Link to comment https://forums.phpfreaks.com/topic/290660-check-a-variable-is-not-a-folderdirectory/ Share on other sites More sharing options...
requinix Posted August 26, 2014 Share Posted August 26, 2014 is_dir Remember that $file is not the complete path so if you do is_dir($file) it will not work. Link to comment https://forums.phpfreaks.com/topic/290660-check-a-variable-is-not-a-folderdirectory/#findComment-1489000 Share on other sites More sharing options...
p5y Posted August 26, 2014 Author Share Posted August 26, 2014 ah got it if ($file != "." && $file != ".." && !is_dir("uploads/$file") ) thanks Link to comment https://forums.phpfreaks.com/topic/290660-check-a-variable-is-not-a-folderdirectory/#findComment-1489002 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.