What is rewinddir in PHP Directory
In this article I am going to explain about rewinddir function in PHP.
PHP rewinddir() function
The directory rewinddir function is used to resets a directory handle opened by opendir function.
Syntax of rewinddir function
Parameters in rewinddir function
It has only one parameter:
Parameter |
Description |
dirstream |
It specifies the directory handle to use. |
Example of directory rewinddir function
<html>
<body>
<?php
$dir_name = opendir("C:\wamp\www\Dinesh");
while (($file = readdir($dir_name)) !== false)
{
echo "filename: " . $file . "<br />";
}
rewinddir();
closedir($dir_name);
?>
</body>
</html>
|
Output:

You may also want to read these related articles :here
Ask Your Question
Got a programming related question? You may want to post your question here
Programming Answers here