PHP: [ Select all ]
$ran_logo = array('logo_1.png', 'logo_2.png', 'logo_3.png', 'logo_4.png', 'logo_5.png' ); // array of filenames $i = rand(0, count($ran_logo)-1); $dispalyed_logo = "$ran_logo[$i]";
<img src="./themes/Your_Theme/images/<?PHP echo $displayed_logo; ?>" width="500px" height="150px" alt="">
echo '<img src="./themes/Your_Theme/images/'. $displayed_logo .'" width="500px" height="150px" alt="">';
Code: [ Select all ]
#headerlogo { background: url("../images/header/logo.png") no-repeat; width:968px; height: 180px; margin:0 auto;}
#headerlogo { width:968px; height: 180px; margin:0 auto;}
echo '<div class="headbg">';
$rl = array('logo1.png', 'logo2.png', 'logo3.png', 'logo4.png', 'logo5.png'); shuffle($rl); $displayed_logo = array_rand($rl, 1);
<div id="headerlogo"></div>
<div id="headerlogo" style="background: url("../images/header/'. $displayed_logo .'") no-repeat;"></div>
output generated using printer-friendly topic mod. All times are GMT - 7 Hours