Hey all,
I've a sneaking suspision that I'm missing somethimg fundamental here, but what I'm trying to do is take a directory listing and push all the .jpgs and .gifs to an array called $image_arry.
Here is the code,
<snippet>
$dir = opendir(".");
$image_array = array();
while (gettype($file = readdir($dir)) != boolean) {
if (($file != ".") && ($file != "..")) {
$filename = explode(".", $file);
$file_ext = $filename[count($filename)-1];
if (($file_ext = "jpg") || ($file_ext = "gif")) {
$image_array = array_push($image_array, $file);
}
}
}
</snippet>
My browser comes back with:
First argument to array_push() needs to be an array in test.php on line 39
Even when I force the type to be an array settype($image_array, 'array'); I get back an empty array.
Any body got any I ideas?
Thanks,
HS