Dir-returned instance Directory class,
Description
Dir
Dir (
String $ path;
Resource $ processing;
The string is changed to (invalid)
Invalid Rewind (invalid)
Invalid closeness (invalid)
)
. 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.
<? Php
$ D = dir ("/etc/php5 ");
Echo "Handle:". $ d-> handle. "n ";
Echo "Path:". $ d-> path. "n ";
While (false! ==( $ Entry = $ d-> read ())){
Echo $ entry. "n ";
}
$ D-> close ();
?>