I'd try something like this:
- create a php array of the html you need to switch
- randomize the array using shuffle
- take the first element of the array and display it
Code:
$imageArray = array(
"<a href='image1link.php'><img src='image1.gif' onmouseover='this.src=\'image1_over.gif\';' onmouseout='this.src=\'image1.gif\';'></a>",
"<a href='image2link.php'><img src='image2.gif' onmouseover='this.src=\'image2_over.gif\';' onmouseout='this.src=\'image2.gif\';'></a>"
);
shuffle($imageArray);
echo ($imageArray[0]);
Untested and I am not Mr PHP
Bookmarks