note 112227 added to function.array-rand

From: Date: Sun, 19 May 2013 09:49:28 +0000
Subject: note 112227 added to function.array-rand
Groups: php.notes 
Request: Send a blank email to php-notes+get-194856@lists.php.net to get a copy of this message
Note: array_rand uses the libc generator, which is slower and less-random than Mersenne Twister. <?php $a = ['http://php.net/', 'http://google.com/', 'http://bbc.co.uk/']; $website = $a[mt_rand(0, count($a) - 1)]; ?> This is a better alternative. ---- Server IP: 94.76.225.145 Probable Submitter: 86.31.19.255 ---- Manual Page -- http://php.net/manual/en/function.array-rand.php Edit -- https://master.php.net/note/edit/112227 Del: integrated -- https://master.php.net/note/delete/112227/integrated Del: useless -- https://master.php.net/note/delete/112227/useless Del: bad code -- https://master.php.net/note/delete/112227/bad+code Del: spam -- https://master.php.net/note/delete/112227/spam Del: non-english -- https://master.php.net/note/delete/112227/non-english Del: in docs -- https://master.php.net/note/delete/112227/in+docs Del: other reasons-- https://master.php.net/note/delete/112227 Reject -- https://master.php.net/note/reject/112227 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#194856) next »