RecursiveDirectoryIterator class
<?php
$rootDir = 'test_dir';
$it = new RecursiveIteratorIterator(
new RecursiveDirectoryIterator($rootDir, RecursiveDirectoryIterator::SKIP_DOTS)
);
$numberOfFiles = iterator_count($it);
echo $numberOfFiles;
<?php
$rootDir = 'test_dir';
$it = new RecursiveIteratorIterator(
new RecursiveDirectoryIterator($rootDir, RecursiveDirectoryIterator::SKIP_DOTS)
);
$numberOfFiles = iterator_count($it);
echo $numberOfFiles;
Leave a Comment
Cancel reply