dinamic array in a while loop

Ask about general coding issues or problems here.

Moderators: egami, macek, gesf

Post Reply
mjr
New php-forum User
New php-forum User
Posts: 18
Joined: Fri Sep 27, 2002 6:35 am
Contact:

Fri Oct 25, 2002 10:02 am

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>
With best regards,
Cyril Kobets
http://ebusiness-news.blogspot.com

Post Reply