JREAM Posted July 24, 2009 Share Posted July 24, 2009 I almost have it, what do i need to ignore any file? I know if i do it ill end up doing way too long is there an easy way to do this? function themeList ($directory) { $results = array(); $handler = opendir($directory); while ($name = readdir($handler)) { if ($name != '.' && $name != '..') { $results[] = $name; } } closedir($handler); return $results; } Link to comment https://forums.phpfreaks.com/topic/167284-trying-to-list-only-directorys-not-files/ Share on other sites More sharing options...
rhodesa Posted July 24, 2009 Share Posted July 24, 2009 just use http://php.net/is_dir Link to comment https://forums.phpfreaks.com/topic/167284-trying-to-list-only-directorys-not-files/#findComment-882049 Share on other sites More sharing options...
rhodesa Posted July 24, 2009 Share Posted July 24, 2009 or actually... $dirs = glob('$',GLOB_ONLYDIR); foreach($dirs as $dir){ } Link to comment https://forums.phpfreaks.com/topic/167284-trying-to-list-only-directorys-not-files/#findComment-882051 Share on other sites More sharing options...
JREAM Posted July 24, 2009 Author Share Posted July 24, 2009 im triyng it Link to comment https://forums.phpfreaks.com/topic/167284-trying-to-list-only-directorys-not-files/#findComment-882070 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.