foreach($sponsors as $company){ $output = ' <div class="sponsor" title="Click to flip"> <div class="sponsorFlip"> <img src="img/sponsors/'.$company[0].'.png" alt="More about '.$company[0].'" /> </div> <div class="sponsorData"> <div class="sponsorDescription"> '.$company[1].' </div> <div class="sponsorURL"> <a href="'.$company[2].'">'.$company[2].'</a> </div> </div> </div> ';}echo $output;