Return to Snippet

Revision: 55395
at February 5, 2012 05:44 by pruntrut


Initial Code
$dir = 'images';
$dirname = $dir;

           
    if ( $dir = opendir($dirname)) {
    while (false !== ($file = readdir($dir))) {
        if ($file != "." && $file != ".." ) {
       
         $tableau[] = $file;
                  // variable qui compte le nombre de fichiers dans le dossier
            $nbr = count($tableau);
        }
    }
    closedir($dir);

         for ($i = 0 ; $i < $nbr  ; $i++)
        
                 {
    
                echo'   <img src="'.$dirname.'/'.$tableau[$i].'" class="full" alt="&nbsp;" width="520" />';
                
                  }
            }

Initial URL

                                

Initial Description

                                

Initial Title
Loop dans repertoire

Initial Tags
php, images

Initial Language
PHP