diff --git a/reference/dir/functions/readdir.xml b/reference/dir/functions/readdir.xml index 106a61a7fc..280861150d 100644 --- a/reference/dir/functions/readdir.xml +++ b/reference/dir/functions/readdir.xml @@ -14,8 +14,8 @@ resourcedir_handle - Returns the filename of the next file from the directory. The - filenames are returned in the order in which they are stored by + Returns the name of the next entry in the directory. The + entries are returned in the order in which they are stored by the filesystem. @@ -42,7 +42,7 @@ &reftitle.returnvalues; - Returns the filename on success&return.falseforfailure;. + Returns the entry name on success&return.falseforfailure;. &return.falseproblem; @@ -51,7 +51,7 @@ &reftitle.examples; - List all files in a directory + List all entries in a directory Please note the fashion in which readdir's return value is checked in the examples below. We are explicitly @@ -68,16 +68,16 @@ if ($handle = opendir('/path/to/files')) { echo "Directory handle: $handle\n"; - echo "Files:\n"; + echo "Entries:\n"; /* This is the correct way to loop over the directory. */ - while (false !== ($file = readdir($handle))) { - echo "$file\n"; + while (false !== ($entry = readdir($handle))) { + echo "$entry\n"; } /* This is the WRONG way to loop over the directory. */ - while ($file = readdir($handle)) { - echo "$file\n"; + while ($entry = readdir($handle)) { + echo "$entry\n"; } closedir($handle); @@ -90,16 +90,16 @@ if ($handle = opendir('/path/to/files')) { - List all files in the current directory and strip out <literal>.</literal> + List all entries in the current directory and strip out <literal>.</literal> and <literal>..</literal>