ok a little bit of nfo before i get to my problem, there are images in 'images/' like so;
39_images01.jpg
39_images02.jpg
40_you are crazy.jpg
40_one-two.jpg
ok so, i have the following code;
PHP Code:
function MainPic($GID) {
$handle = opendir("images");
while ($file = readdir($handle)) {
if ($file != "." && $file != ".."){
$array = split("_",$file);
if ($array[0] == $GID){
echo ($file."<br>\n");
}
}
}
closedir($handle);
}
so if you can imagine i call my function like;
$GID="39";
MainPic($GID);
then im going to get a list of the images (from above)
39_images01.jpg
39_images02.jpg
right? ... ok, so instead of echoing the files, i would like to put them into an array, because im going to use array_rand in the future to display a random image for the appropriate $GID call .. can any help me with this? I checked the array section on php.net and didnt see any examples of creating arrays with adding $file ..
any ideas?
lol.. and I always feel bad saying "Your welcome" if I the help was mutually offered, as I feel like I'm saying to the other poster "Hey look, he said thank you, and it must have been to me..." That's just me, I guess... Anyway, for my part, you're welcome...
Bookmarks