Tazerenix Posted January 7, 2010 Share Posted January 7, 2010 Sup I'm wondering if anyone could tell me a way of (like phpbb or wordpress) detecting style/theme folders and then reading from a file inside them to get their name and such. So in /themes/ the php script would detect all the directory's inside the themes directory and then inside those directory's it will read from a file (say theme.php or something) and detect those variables There is obviously a way to do this but could someone please explain what it is? (sorry if i was unclear) Link to comment https://forums.phpfreaks.com/topic/187549-detecting-whether-there-is-a-folder-then-reading-from-a-file-inside-the-folder/ Share on other sites More sharing options...
cags Posted January 7, 2010 Share Posted January 7, 2010 If you are using PHP >= 5 then you can use scandir to read the contents of a file, otherwise you can use a combination of opendir and readdir. Depending on your exact requirements you may also find DirectoryIterator useful. Link to comment https://forums.phpfreaks.com/topic/187549-detecting-whether-there-is-a-folder-then-reading-from-a-file-inside-the-folder/#findComment-990201 Share on other sites More sharing options...
Tazerenix Posted January 7, 2010 Author Share Posted January 7, 2010 hmm alright, i also got a script from a friend that looks good aswell, i'll use a combo of both so i can read a file inside the dir to check what theme it is thanks Link to comment https://forums.phpfreaks.com/topic/187549-detecting-whether-there-is-a-folder-then-reading-from-a-file-inside-the-folder/#findComment-990204 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.