steviez Posted June 16, 2009 Share Posted June 16, 2009 Hi, Is there a way with PHP to scan a folder for empty folders? Thanks Quote Link to comment https://forums.phpfreaks.com/topic/162394-is-this-at-all-possable/ Share on other sites More sharing options...
premiso Posted June 16, 2009 Share Posted June 16, 2009 scandir should be right down your alley. Quote Link to comment https://forums.phpfreaks.com/topic/162394-is-this-at-all-possable/#findComment-857162 Share on other sites More sharing options...
Maq Posted June 16, 2009 Share Posted June 16, 2009 Try this, an example from the manual: isEmptyDir($dir){ return (($files = scandir($dir)) && count($files) } ?> Quote Link to comment https://forums.phpfreaks.com/topic/162394-is-this-at-all-possable/#findComment-857164 Share on other sites More sharing options...
steviez Posted June 16, 2009 Author Share Posted June 16, 2009 The problem is the that directories are like this: uploads_public/10405/27101/5315/24927/18159/ Thanks Quote Link to comment https://forums.phpfreaks.com/topic/162394-is-this-at-all-possable/#findComment-857169 Share on other sites More sharing options...
premiso Posted June 16, 2009 Share Posted June 16, 2009 The problem is the that directories are like this: uploads_public/10405/27101/5315/24927/18159/ Thanks Ok you are providing one lined information that does not help us, help you solve your problem. The scandir function can be coded (if you look at the user functions) to recursively traverse directories. Be specific on what you want, not just "I need this" then 5 posts later, "Oh and this is another part" then 10 posts later, "and I forgot about this". Write what the issue is out in full and state it exactly, or else we are just picking at straws here. Quote Link to comment https://forums.phpfreaks.com/topic/162394-is-this-at-all-possable/#findComment-857178 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.