Re: beginner question about while loops
| From: | Paul Furman | Date: | Fri, 06 Feb 2004 20:47:56 +0000 |
| Subject: | Re: beginner question about while loops | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-177045@lists.php.net to get a copy of this message | ||
OK thanks again for helping through the stumbling blocks... I'm rolling again now.
John W. Holmes wrote:
Just make sure $pictures is defined as an array before you try to push a value onto it (even using the method you have now), otherwise you'll get a warning.It seems to be working fine this way without defining it as an array but I guess other languages would not accept that approach. while ($file = readdir($dh)){
if (strstr ($file, '.jpg')){
$pictures[] = $file;
}