rewinddir.php :
<?php
//Open send directory
if(@$dir = opendir("send"))
{
//List files in send directory
while (($file = readdir($dir)) !== false)
{
echo "filename: " . $file . "<br />";
}
//resets the directory stream
rewinddir($dir);
//to check for changes
closedir($dir);
}
else
{
echo 'directory not opened';
}
?>
outputs :
1)
directory not opened
2)
filename: .
filename: ..
filename: sendsms.html
filename: sendsms.php
filename: send_vard.php
filename: send_vcard_sms.html
filename: smser.php
<?php
//Open send directory
if(@$dir = opendir("send"))
{
//List files in send directory
while (($file = readdir($dir)) !== false)
{
echo "filename: " . $file . "<br />";
}
//resets the directory stream
rewinddir($dir);
//to check for changes
closedir($dir);
}
else
{
echo 'directory not opened';
}
?>
outputs :
1)
directory not opened
2)
filename: .
filename: ..
filename: sendsms.html
filename: sendsms.php
filename: send_vard.php
filename: send_vcard_sms.html
filename: smser.php