note 71372 added to function.rand

From: Date: Fri, 24 Nov 2006 21:33:37 +0000
Subject: note 71372 added to function.rand
Groups: php.notes 
Request: Send a blank email to php-notes+get-120060@lists.php.net to get a copy of this message
is there a way in which to declare let's say 20 different numbers, which are not chronologic and have the random function pick up one number at a time? at the moment i am using this code: srand((double)microtime()*1000000); $num = rand(846,1100); include ('quote'.$num.'.html'); the issue with my code here is that some numbers between 846 and 1100 may not have a corresponding web page, therefore i would like to declare all available html pages with numbers and use the rand function or something else to use one at a time any ideas? many thanks in advance ---- Server IP: 66.163.161.117 Probable Submitter: 80.97.185.165 ---- Manual Page -- http://www.php.net/manual/en/function.rand.php Edit -- https://master.php.net/note/edit/71372 Del: integrated -- https://master.php.net/note/delete/71372/integrated Del: useless -- https://master.php.net/note/delete/71372/useless Del: bad code -- https://master.php.net/note/delete/71372/bad+code Del: spam -- https://master.php.net/note/delete/71372/spam Del: non-english -- https://master.php.net/note/delete/71372/non-english Del: in docs -- https://master.php.net/note/delete/71372/in+docs Del: other reasons-- https://master.php.net/note/delete/71372 Reject -- https://master.php.net/note/reject/71372 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#120060) next »