lockdownd7 Posted September 4, 2009 Share Posted September 4, 2009 I need the scandir() function to return an array that includes actual directory names, instead of something like '.' or '..' . What would be the best way to do that? Link to comment https://forums.phpfreaks.com/topic/173132-reading-directory-names-w-scandir/ Share on other sites More sharing options...
Mark Baker Posted September 4, 2009 Share Posted September 4, 2009 scandir() will still return . and .. but if you need it, then use it though a better alternative might be glob() Link to comment https://forums.phpfreaks.com/topic/173132-reading-directory-names-w-scandir/#findComment-912533 Share on other sites More sharing options...
.josh Posted September 4, 2009 Share Posted September 4, 2009 if you are looking for an array of ONLY dir names, excluding . and .. then glob will indeed work for you: $dirs = glob('*',GLOB_ONLYDIR); Link to comment https://forums.phpfreaks.com/topic/173132-reading-directory-names-w-scandir/#findComment-912607 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.