Read dir of the pseudo object-oriented mechanism. The given dir is open. The two attributes can be opened once the dir has been opened. The processed property can be used with other dir functions, such as readdir (), rewinddir () and closedir ()
Dir-returned instance Directory class,
Description
Dir
Dir (
String $ path;
Resource $ processing;
The string is changed to (invalid)
Invalid rewind (invalid)
Invalid closeness (invalid)
)
Read dir of the pseudo object-oriented mechanism. The given dir is open. The two attributes can be opened once the dir has been opened. The processed property can be used with other dir functions, such as readdir (), rewinddir () and closedir (). The path attribute is set to the dir of the path. There are three methods: Reading, rewind, and closeness.
Instance
Example of # dir ()
Pay attention to fashion. The returned value of dir: Read () is checked in the following example. Whether we explicitly test whether the return value is the same (equivalent to the same type-see more information of comparison operators) false, because otherwise, if the name of any dir item is calculated as false, the loop is stopped.
$ D = dir ("/etc/php5 ");
Echo "Handle:". $ d-> handle. "n ";
Echo "Path:". $ d-> path. "n ";
While (false! ==( $ Entry = $ d-> read ())){
Echo $ entry. "n ";
}
$ D-> close ();
?>