Aadi
Aadi

Reputation: 7109

PHP Root Directory Listing

There is any ways to listing all main directories present in php server(may it is wamp or xampp).

Upvotes: 2

Views: 2360

Answers (2)

JeroenEijkhof
JeroenEijkhof

Reputation: 2222

The glob() function mentioned is interesting, check it out here

If you use it without specifying the path and only givin a file extension, for instance "*.php" it will search within the current directory.

Upvotes: 0

VolkerK
VolkerK

Reputation: 96159

Depending on what you mean by "root directory" it could be as simple as

foreach( glob($_SERVER['DOCUMENT_ROOT'] .'/*', GLOB_ONLYDIR) as $fn) {
  echo basename($fn), "<br />\n";
}

Upvotes: 3

Related Questions