I am trying to read all file names in a directory into an array. I run it (showPhoto.php) on server side. There was no error, no anything. I tried to insert a few "echo". All "echo" did not run...What's wrong with it? I am confused. Please help!
--------------
<?php
$aImages = array ( );
$dirpath = "Image/";
$iNumber = 0;
$diraccess = opendir($dirpath);
while ( false != ($filename = readdir($diraccess)) )
{
if( ($filename != ".") && ($filename != "..") )
{
$iNumber ++;
$aImages[$iNumber] = $filename;
echo "try2 <br>";
}
}
closedir($diraccess);
echo "try3 <br>";
?>
--------------
<?php
$aImages = array ( );
$dirpath = "Image/";
$iNumber = 0;
$diraccess = opendir($dirpath);
while ( false != ($filename = readdir($diraccess)) )
{
if( ($filename != ".") && ($filename != "..") )
{
$iNumber ++;
$aImages[$iNumber] = $filename;
echo "try2 <br>";
}
}
closedir($diraccess);
echo "try3 <br>";
?>