In php, you can use DirectoryIterator to obtain the files or directories in the specified directory. $ path = "/tmp"; $ oDir = newDirectoryIterator (DirectoryIterator and RecursiveDirectoryIterator in php
In php, you can use DirectoryIterator to
In php, you can use DirectoryIterator to obtain the files or directories in the specified directory. $ pathtmp; $ Paths ($ path); foreach ($ oDiras $ file) in php. DirectoryIterator and RecursiveDirectoryIterator
In php, you can use
In php, DirectoryIterator and RecursiveDirectoryIteratorphp can be used to obtain the files or directories in the specified directory. $ pathtmp; $ oDirnewDirectoryIterator ($ path); foreach ($ oDiras $ file) {DirectoryIterator and
Iterator mode
Echo ' program start: '. Time (). '
';
$path = ' d:/www ';
Getrevdir ($path);
Echo ' program end: '. Time (). '
';
Exit
Echo '
';Get all directories and filenames under the current pathThis usage is mainly used in the B/s program to
Directoryiterator and Recursivedirectoryiterator in PHP
In PHP, you can use Directoryiterator to get the file or directory of the specified directory.
$path = "/tmp"; $oDir = new Directoryiterator ($path); foreach ($oDir as $file) { if ($file-
SPL provides multiple iterator classes that provide iterative access, filtering data, caching results, and controlling paging. , because PHP is always growing, I try to list all of the iteration classes in SPL. Some of the following iterator classes
PHP SPL Directoryiterator How to get a list of site directories
Since PHP 5.0 PHP has added a number of built-in components and interfaces, such as SPL (Standard PHP library, full name: standardized PHP libraries), the library defines a number of
PHP extension-compression and archive extension-the Phar archive concept comes from the JAR archive of Java technology, which allows the use of a single file to package applications, this file contains everything required to run the application.
Share: PHP file traversal methods
/**
* Obtain all files in the current directory and subdirectory.
* @ Param string $ dir path name
* @ Return array path array of all files
*/
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.