Love Fuel?    Donate

FuelPHP Forums

Ask your question about FuelPHP in the appropriate forum, or help others by answering their questions.
Directory recursive iterator
  • Hello. I need to get all directories from upload directory.
    I don't know how do this. I think that I must use File class. This class i good for listing all files from directory. Can you help to solve this problem. Thanks.
  • See http://docs.fuelphp.com/classes/file/usage.html#/method_read_dir If you want directories only, you need to include a filter that excludes files, and lists only directories:
    // Read directories only
    $contents = File::read_dir($youruploaddir, 0, array(
        '!.*' => 'file', // exclude all files
    ));
    

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

In this Discussion