Php readdir function usage instance, readdir function instance. Php readdir function usage example. readdir function example this article describes the usage of readdir function in php. Share it with you for your reference. The usage analysis is as
Determines whether the directory is empty, true is null, false is not empty function Is_empty_dir ($fp) {$H = @ opendir ($fp), $i =0, while ($_file=readdir ($H)) {$i + +;} Closedir ($H); if ($i >2) {return false;} Else{return true;}} 1. Determine if
PHP readdir () function, phpreaddir function. PHP readdir () function, phpreaddir function is recently learning about PHP file operations, record one of the notes of readdir () function 1, in $ tempreaddir ($ handle) readdir () function of PHP in
* ** Test the folder command and copy the installation directory of a program to the project * traverse all directories and files in the specified directory * readdir () the function returns the file name * is_dir () of the next file in the
Why are the codes of the two readdir loops different? You can only obtain part of the file in the previous section.
$ Han2 = opendir ('dir ');
While (readdir ($ han2 )! = False ){
Echo readdir ($ han2 );
Echo"
";
}
Closedir ($ han2 );
This section
Definition and usageThe readdir () function returns the entries in the directory handle opened by opendir (). If yes, the function returns a file name; otherwise, false.Instance 1*/$ Dir = "readdir /";// Determine whether it is a directoryIf (is_dir
This article mainly introduces the usage of the readdir function in php, and describes the specific usage and precautions of the readdir function operation directory in examples, which is of great practical value, for more information about readdir
The previous paragraph can only get a portion of the file
$han 2 = opendir (' dir ');
while (Readdir ($han 2)!== false) {
Echo Readdir ($han 2);
echo "
";
}
Closedir ($han 2);
This section can get all the documents
$od = Opendir (' dir ');
while ((
This article illustrates the use of Readdir functions in PHP. Share to everyone for your reference. The specific usage analysis is as follows:
Definition and Usage: the Readdir () function returns an entry in a table of contents handle opened by
The Readdir () function returns the file name of the next file in the directory. Returns the entry name (file name) if successful, and FALSE if it fails.
Grammar
Readdir (Dir_handle);
Parameters
Description
Dir_handle
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.