dinamic array in a while loop

A

Anonymous

Guest
use
<html><body>
<?
$path = 'images/';
$counter=0;
$counterStart = 0 ;
$counterEnd = $counterStart + 16 ;
$img='';
$imgTotal=0;
$dir_handle = @opendir($path) or die("Unable to open $path");
while($file = readdir($dir_handle)) {
if (substr($file, -3) == 'gif') {
$imgTotal++;
$counter++ ;
if ($counter > $counterStart && $counter < $counterEnd) {
$images[$counter]=$file;
//$img=$file;
} }}
closedir($dir_handle);

for($i=0;$i!=count($images);$i++){
echo "$file<br>";
}

?>

</body></html>
 
Back
Top