tibberous Posted September 19, 2007 Share Posted September 19, 2007 I am looking for a script that displays main categories, and when you click a main category, it brings up the subcategory, and when you click a subcategory, it brings up another one, until you are at the last level. Or anything like that. Anyone have or know of anything like that? I'll even take something you wrote for an old project if you think it is somewhat tweakable. Thanks, Trent Quote Link to comment https://forums.phpfreaks.com/topic/69948-simple-directory-script/ Share on other sites More sharing options...
lemmin Posted September 19, 2007 Share Posted September 19, 2007 This recusively enumerates everything below the directory you input. doDir(glob("tier 1/*")); function doDir($files) { foreach($files as $file) { if (is_dir($file)) doDir(glob($file . "/*")); else //do something with the file. } } Quote Link to comment https://forums.phpfreaks.com/topic/69948-simple-directory-script/#findComment-351414 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.