<?php $pics=array("img1.jpg", "img2.jpg"); $rand=rand(0, count($pics)); echo "<img src=\"".$pics[$rand]."\"/>"; ?>