php-src/ext/spl/examples/directorytree.php
Marcus Boerger 159c538bcf Major update:
- Remove all overloading hooks -> array_read/array_access must be rewritten
- Remove all basic iterators
- Remove all 'spl_' prefixing exposed to user level
- Add RecursiveIterator, RecursiveIteratorIterator
- Add DirectoryIterator, DirectoryTreeIterator
- Add some examples
2003-11-09 14:05:36 +00:00

17 lines
327 B
PHP
Executable File

<?php
/** tree view example
*
* Usage: php DirectoryTree.php <path>
*
* Simply specify the path to tree with parameter <path>.
*
* (c) Marcus Boerger
*/
$length = $argc > 3 ? $argv[3] : NULL;
foreach(new LimitIterator(new DirectoryTree($argv[1]), @$argv[2], $length) as $pathname => $file) {
echo "$pathname\n";
}
?>