Jump to content

Trying to list Only Directorys, Not Files


JREAM

Recommended Posts

I almost have it, what do i need  to ignore any file?

I know if i do it ill end up doing way too long :( is there an easy way to do this?

function themeList ($directory) {

    $results = array();
    $handler = opendir($directory);

    while ($name = readdir($handler)) {
        if ($name != '.' && $name != '..') {

			$results[] = $name;
	}
    }
    closedir($handler);
    return $results;
}

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.