note 62535 deleted from function.srand by bjori

From: Date: Thu, 02 Mar 2006 17:28:14 +0000
Subject: note 62535 deleted from function.srand by bjori
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-104724@lists.php.net to get a copy of this message
Note Submitter: nino at clan-csc dot com Reason: useless ---- I personally think that srand() doesn't make a lot of sense... Why is this not good as srand() (used rand() ) <? die(); //random message $line = array(); // catch stuff $line[] = "Message one"; $line[] = "Message two"; $line[] = "Message three"; $line[] = "Message four"; $line[] = "Message five"; $line[] = "Message six"; $num = count($line) - 1; $random = rand(0,$num); // <<<< you see?? $oneliner = $line[$random]; //this is the thing to be echoed echo "<p>$oneliner</p>"; /* CSC 2006 Led by Nino, written by Nino http://www.clan-csc.com */ ?>

« previous php.notes (#104724) next »