kapi
August 14th, 2009, 08:17 PM
I'm new to php and am having a little trouble understanding why when I run some code that the out put is not in the order I expect.
code:
--------
<?php
//Open images directory
$dir = opendir("ads");
//List files in images directory
while (($file = readdir($dir)) !== false)
{
echo "filename: " . $file . "<br />";
}
closedir($dir);
?>
output:
---------
filename: two.txt
filename: .
filename: five.txt
filename: four.txt
filename: three.txt
filename: ..
filename: one.txt
----------
Any help would be very much appreciated
code:
--------
<?php
//Open images directory
$dir = opendir("ads");
//List files in images directory
while (($file = readdir($dir)) !== false)
{
echo "filename: " . $file . "<br />";
}
closedir($dir);
?>
output:
---------
filename: two.txt
filename: .
filename: five.txt
filename: four.txt
filename: three.txt
filename: ..
filename: one.txt
----------
Any help would be very much appreciated