First of all, I do not think you are creating the arrays you want? I just looked at the first, which seems ok, now I checked the second too
The following is based on the idea you like to use the basic structure as you defined it.
$magazine[1] = array (
'imagesource' => 'images/pressphotos/usdietthumb.jpg',
'title' => 'Us Today',
'alt' => 'Us Today Magazine Cover',
'content' => array (
'pages' => array(
0=> '2.jpg',
1=> '3.jpg',
2=>'4.jpg'),
'alt' => array(
0=>'Page one',
1=>'Page two',
2=>'Page three'),
'width' => '400',
'height' => '600');
);
better would be to swap some things around:
$magazine[1] = array (
'imagesource' => 'images/pressphotos/usdietthumb.jpg',
'title' => 'Us Today',
'alt' => 'Us Today Magazine Cover',
'content' => array (
0=> array(
'pages'=> '2.jpg',
'alt' =>'Page one',
'width' => '400',
'height' => '600')
);
);
When deadling with output & array, I like to keep it as stupid and simple as possible, because it gives you overview. So I would do a bit of subsetting for the time being, when that works, you can always remove the added steps:
if(isset($magazineselect) && is_array($magazine[$magazineselect]))
{
$current = $magazine[$magazineselect];
echo $current['imagesource']; // Just to show something, as a errortrapping help, remote later
if(is_array($current['content']))
{
foreach($current['content'] as $id=> $content)
{
if(is_array($content[page]))
{
etc
}
}
The exact processing of the array depends on the structure you choose for it, but you get the drift?