note 63131 added to function.rand

From: Date: Tue, 14 Mar 2006 07:39:42 +0000
Subject: note 63131 added to function.rand
Groups: php.notes 
Request: Send a blank email to php-notes+get-105770@lists.php.net to get a copy of this message
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 ---- Server IP: 84.18.202.180 Probable Submitter: 86.132.170.160 ---- X-Spam-Status: Yes, hits=5.2 required=5.0 tests=DATE_MISSING,FROM_NO_LOWER, HTML_IMAGE_ONLY_04,HTML_MESSAGE autolearn=no version=2.64 ---- Manual Page -- http://www.php.net/manual/en/function.rand.php Edit -- http://master.php.net/note/edit/63131 Del: integrated -- http://master.php.net/note/delete/63131/integrated Del: useless -- http://master.php.net/note/delete/63131/useless Del: bad code -- http://master.php.net/note/delete/63131/bad+code Del: spam -- http://master.php.net/note/delete/63131/spam Del: non-english -- http://master.php.net/note/delete/63131/non-english Del: in docs -- http://master.php.net/note/delete/63131/in+docs Del: other reasons-- http://master.php.net/note/delete/63131 Reject -- http://master.php.net/note/reject/63131 Search -- http://master.php.net/manage/user-notes.php

« previous php.notes (#105770) next »