Jump to content

Detecting whether there is a folder, then reading from a file inside the folder


Tazerenix

Recommended Posts

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)

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.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.