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? Quote 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() Quote 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); Quote 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
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.