note 63131 deleted from function.rand by mazzanet
| From: | mazzanet@php.net | Date: | Tue, 14 Mar 2006 10:03:15 +0000 |
| Subject: | note 63131 deleted from function.rand by mazzanet | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-105771@lists.php.net to get a copy of this message | ||
Note Submitter: http://www.vainternet.co.uk
Reason: useless
----
This is a function to display random images from an array
put your images in the array and call this function on your page
<? randomimage(); ?>
And put this function in your functions page
<?
function randomimage(){
$rand1 = array("images/image1.gif","images/image2.gif");
srand(time());
$random = (rand()%2);
print("<img src=" . $rand1[$random] . ">");
}
?>
http://www.vainternet.co.uk