[root@file nutch-0.9]# ls resume/
crawldb index indexes linkdb segments
like the above example,
how to get number of sub files(can be file or directory) in PHP?
[root@file nutch-0.9]# ls resume/
crawldb index indexes linkdb segments
like the above example,
how to get number of sub files(can be file or directory) in PHP?
The examples for readdir are most probably what you are looking for.
use the PHP function readdir or scandir in PHP, get the file list as an array and get a count on the array. you may have to do some tweaking to avoid the current and parent directory ( . and .. )
function count_files($path) {
return count(array_diff(scandir($path), array(".", "..")));
}