开发者

PHP Root Directory Listing

开发者 https://www.devze.com 2022-12-23 22:28 出处:网络
There is any ways to listing all main directories present in php server(may it is wamp or xamp开发者_JS百科p).Depending on what you mean by \"root directory\" it could be as simple as

There is any ways to listing all main directories present in php server(may it is wamp or xamp开发者_JS百科p).


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";
}


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消