diff --git a/functions/dir.xml b/functions/dir.xml index 2109f8c4a8..30758deb34 100644 --- a/functions/dir.xml +++ b/functions/dir.xml @@ -1,4 +1,4 @@ - + Directory functions Directories @@ -62,26 +62,26 @@ Description - new dir + object dir string directory A pseudo-object oriented mechanism for reading a directory. The given directory is opened. Two properties - are available once directory has been opened. The handle + are available once the directory has been opened. The handle property can be used with other directory functions such as readdir, rewinddir and closedir. The path property is set to path the directory that was opened. Three methods are available: read, rewind and close. - <function>dir</function> Example + <function>dir</function> example $d = dir("/etc"); echo "Handle: ".$d->handle."<br>\n"; echo "Path: ".$d->path."<br>\n"; -while($entry=$d->read()) { +while ($entry = $d->read()) { echo $entry."<br>\n"; } $d->close(); @@ -159,12 +159,12 @@ $d->close(); - <function>opendir</function> Example + <function>opendir</function> example <?php if ($dir = @opendir("/tmp")) { - while($file = readdir($dir)) { + while ($file = readdir($dir)) { echo "$file\n"; } closedir($dir); @@ -201,7 +201,7 @@ if ($dir = @opendir("/tmp")) { $handle=opendir('.'); echo "Directory handle: $handle\n"; echo "Files:\n"; -while (($file = readdir($handle))!==false) { +while (false !== ($file = readdir($handle))) { echo "$file\n"; } closedir($handle); @@ -221,8 +221,8 @@ closedir($handle); <?php -$handle=opendir('.'); -while (false!==($file = readdir($handle))) { +$handle = opendir('.'); +while (false !== ($file = readdir($handle))) { if ($file != "." && $file != "..") { echo "$file\n"; }