I have a couple of arrays that represent different categories. One
array per category. The arrays contain names of photos. The arrays
look like this:
$cat_1 = array('moonligh t.jpg'', shadow.jpg', 'luna.jpg');
$cat_2 = array(...);
$cat_3 = array(...);
$cat_4 = array(...);
Then, i want to create a thumbnail with all the photos like this:
for($i=0; ...){
....<img src="images/thumbs/<?php echo $cat_1[$i]; ?>" />
}
This works OK for the first array.
What if i'm getting the name of the array from a variable? How do i
construct my 'for loop'.
I do it like this:
$cat = $_GET['cat']; //output: 1
$sel_array = 'cat_' . $cat;//create the string: cat_1
Then i create the thumbs like this:
for($i=0; ...){
....<img src="images/thumbs/<?php echo HELP!!!! ;?>" />
}
How do i construct the thumbnail?
Thanks
Marco
Comment