w3resource
PHP Tutorial

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

PHP Function Reference

Previous: readdir
Next: scandir



New Content: Composer: Dependency manager for PHP, R Programming


bedava porno