RE: [PHP] Am I dreaming or what :)

From: Date: Thu, 04 Sep 2003 07:27:58 +0000
Subject: RE: [PHP] Am I dreaming or what :)
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-161631@lists.php.net to get a copy of this message
this is the way I do if helps //FILES IN DIR TO ARRAY $imgdir = "user/home/"; $lista_imgs = array(); $handle = opendir($imgdir); while ($file = readdir($handle)) {if ($file != "." && $file != "..") {array_push ($lista_imgs, $file);}} closedir($handle); // RANDOM IMG $rdnum = rand(0, count($lista_imgs) - 1); $img_home = $lista_imgs[$rdnum]; I assume there are only GIF or JPG files in the directory saludos aniceto lopez :: DYNAMICAL.BIZ web development & host services Barcelona - Spain -----Mensaje original----- De: John Taylor-Johnston [mailto:taylorjo@collegesherbrooke.qc.ca] Enviado el: jueves, 04 de septiembre de 2003 8:07 Para: php-general@lists.php.net Asunto: [PHP] Am I dreaming or what :) I have a directory jammed-packed with images. I want to read the directory contents /www/usr/htm/images/ and display randomly any *.gif or *.jpg in said directory. Do-able? Seriously? Ideas? Places to start? John -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

« previous php.general (#161631) next »