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 Quote Link to comment https://forums.phpfreaks.com/topic/290660-check-a-variable-is-not-a-folderdirectory/ Share on other sites More sharing options...
Solution requinix Posted August 26, 2014 Solution Share Posted August 26, 2014 (edited) is_dir Remember that $file is not the complete path so if you do is_dir($file) it will not work. Edited August 26, 2014 by requinix Quote 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 Quote 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
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.