note 29388 added to function.rand

From: Date: Wed, 12 Feb 2003 05:46:09 +0000
Subject: note 29388 added to function.rand
Groups: php.notes 
Request: Send a blank email to php-notes+get-43813@lists.php.net to get a copy of this message
To display random text..by a rookie <? $url[0]="1"; $url[1]="2"; $url[2]="3"; $url[3]="4"; $url[4]="5"; $url[5]="6"; $i=rand($url[0], $url[5]); switch($i) { case 1: $url="ALTAVISTA"; break; case 2: $url="HOTBOT"; break; case 3: $url="DOGPILE"; break; case 4: $url="ABOUT"; break; case 5: $url="GOOGLE"; break; case 6: $url="YAHOO"; break; } echo $url; ?> -- http://www.php.net/manual/en/function.rand.php http://master.php.net/manage/user-notes.php?action=edit+29388 http://master.php.net/manage/user-notes.php?action=delete+29388 http://master.php.net/manage/user-notes.php?action=reject+29388

« previous php.notes (#43813) next »