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 can retrieve all files
$ Od = opendir ('dir ');
While ($ readd = readdir ($ od ))! = False ){
Echo $ readd;
Echo"
";
}
Closedir ($ od );
Reply to discussion (solution)
Readdir returns the file name of the next file in the directory.
Your first code uses only half of the results.
Dir contains three files, a B c. Previous paragraph while (readdir ($ han2 )! = False) after running, the cursor will only be moved to the end of a. when running echo readdir ($ han2), you will only read to B. This problem can be completely avoided when the following section is received with variables.
Readdir returns the file name of the next file in the directory.
Your first code uses only half of the results.
I would like to explain why the current directory (.) and the output of the upper-level Directory (..) are displayed when the page is output (..)
Which of the following functions does readdir provide?
Dir contains three files, a B c. Previous paragraph while (readdir ($ han2 )! = False) after running, the cursor will only be moved to the end of a. when running echo readdir ($ han2), you will only read to B. This problem can be completely avoided when the following section is received with variables.
Thank you.
And... are also Directory items, of course, will be displayed
If not, you have to judge.
Readdir returns the file name of the next file in the directory.
Your first code uses only half of the results.
I would like to explain why the current directory (.) and the output of the upper-level Directory (..) are displayed when the page is output (..)
Which of the following functions does readdir provide?
It was intentionally designed in the PHP Kernel. it may be called the readdir function of C, and the readdir function of C also reads.