18 September, 2008

PHP - roots list

Unfortunately, I don't know another way how to resolve all roots (drives) under Windows:
public function getRoots() {
$roots = array();
for ($i='A'; $i<'Z'; $i++) {
$disk=$i.':\\';
if (is_dir($disk) && is_readable($disk))
$roots[] = $disk;
}
return $roots;
}

Somebody know?

No comments: