Random Images with PHP
Devlounge has posted an article for displaying random images with PHP.
Every now and then you want to randomize images, usually headers of sorts. This is pretty simple, with just 9 lines of PHP code you can rotate randomly between two images.
PHP:
This will rotate between image1.gif and image2.gif, which are located in /mysite/randomimages/ on your server.
Check out the full post here

My name is Noah Everett. I live in Tulsa, OK. I started 
Why not have an array based off images in a folder
$headers=Array();
$dir = "../headers/";
$dh = opendir($dir) or die ("could not open dir");
$rString ="";
$i = 0;
while ( !(($file = readdir($dh)) === false) ){
if ($file == "." || $file == "..") continue;
if (eregi("(.jpg)$",$file)){
$headers[] .= $file;
}
}
closedir($dh);
$randomheader=$headers[array_rand($headers)];