Recently in the knowledge of PHP file operations, record the Readdir () function one of the points to note
1, in the $temp=readdir ($handle) function Readdir Gets the file name and the folder name in $handle,
Typically traversing a file through a while () loop in a program:
while ($temp =readdir ($handel)) {}
However, there is a problem with the judgment statement: if $handle has a folder under the name of ' 0 ', then the $temp=0,while loop cannot proceed, then the rest of the file cannot be traversed, resulting in the program result is not correct,
The correct wording:
while (($temp =readdir ($handel))!==false) {}//is not fully equal to the difference if the folder name is 0, then 0!==false can still traverse
The above describes the PHP Readdir function, including the aspects of the content, I hope the PHP tutorial interested in a friend helpful.