while ($file = readdir($dh)){ if (strstr ($file, '.jpg')){ $pictures[] = $file; }
Spotted this problem when staring at your code.
Number of open braces: 2 Number of close braces: 1
You need to close off your while loop.
Should I set up a counter for loops $integer++ or if I'm going through something
You can if you like, but it is not necessary in this case.
the while function knows to just go through those and fills in array numbers accordingly?
The while function has nothing to do with it. Using the syntex $array[] simply adds an element onto the _end_ of the array and PHP picks the next logical, numerical index.
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php