Heres the finished code 
PHP Code:
<?php
$banners = array(
1=>"banner1.jpg",
2=>"banner2.jpg",
3=>"banner3.jpg");
$footers = array(
1=>"footer1.jpg",
2=>"footer2.jpg",
3=>"footer3.jpg");
$num = rand(1, count($banners));
$bannerFile = getimagesize($banners[$num]);
$bannerW = $bannerFile[0];
$bannerH = $bannerFile[1];
$footerFile = getimagesize($footers[$num]);
$footerW = $footerFile[0];
$footerH = $footerFile[1];
echo "The header image to display is: $banners[$num], the width is $bannerW and the height is $bannerH";
echo "<br />\nAnd the footer image to display is: $footers[$num], the width is $footerW and the height is $footerH";
echo "<img src=\"$banners[$num]\" width=\"$bannerW\" height=\"$bannerH\" /><br />\n";
echo "<img src=\"$footers[$num]\" width=\"$footerW\" height=\"$footerH\" /><br />\n";
?>