"Paul Furman" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Eric Gorr wrote:

[snip]

>
>    while ($file = readdir($fh)){
>        if (strstr ($file, '.jpg')){
>        $pictures[] = $file;
>        #print $pictures[];  #Fatal error: Cannot use [] for reading

Which element are you trying to print?  I'm guessing the current one, so
just use:
  print $file;

>        }
>    var_dump ($pictures[]); #Fatal error: Cannot use [] for reading
>    }
>
>
>
> This one works but complains about Undefined variable: pictures NULL
> array (but it dumps the contents of $pictures[]:
>
>    while ($file = readdir($fh)){
>        if (strstr ($file, '.jpg')){
>        $pictures[] = $file;
>        }
>    var_dump ($pictures);
>    }

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to