PHP: rewinddir() function
Description
The rewinddir() function is used to rewind directory handle.
Version:
(PHP 4 and above)
Syntax:
rewinddir(dir_handle)
Parameter:
Name | Description | Required / Optional |
Type |
---|---|---|---|
dir_handle | Specified directory handle, previously open by opendir(). | Required | Resource |
Example :
<?php
$dir_name = opendir("test");
while (($file = readdir($dir_name)) !== false)
{
echo "filename: " . $file . "<br />";
}
rewinddir();
closedir($dir_name);
?>
See also
- Weekly Trends and Language Statistics
- Weekly Trends and Language Statistics