What is rewinddir in PHP Directory

In this article I am going to explain about rewinddir function in PHP.
  • 1552

PHP rewinddir() function

The directory rewinddir function is used to resets a directory handle opened by opendir function.

Syntax of  rewinddir function

rewinddir(dirstream)

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:

rewinddir function.jpg

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

Categories

More Articles

© 2020 DotNetHeaven. All rights reserved.