note 124684 added to function.array-rand

From: Date: Wed, 05 Feb 2020 10:18:29 +0000
Subject: note 124684 added to function.array-rand
Groups: php.notes 
Request: Send a blank email to php-notes+get-214001@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/', 'https://google.com/', 'https://ontopnaija.com/']; $website = $a[mt_rand(0, count($a) - 1)]; ?> This is a better alternative. ---- Server IP: 45.112.84.4 Probable Submitter: 185.85.3.195 (proxied: 197.210.84.76) ---- Manual Page -- http://php.net/manual/en/function.array-rand.php Edit -- https://master.php.net/note/edit/124684 Del: integrated -- https://master.php.net/note/delete/124684/integrated Del: useless -- https://master.php.net/note/delete/124684/useless Del: bad code -- https://master.php.net/note/delete/124684/bad+code Del: spam -- https://master.php.net/note/delete/124684/spam Del: non-english -- https://master.php.net/note/delete/124684/non-english Del: in docs -- https://master.php.net/note/delete/124684/in+docs Del: other reasons-- https://master.php.net/note/delete/124684 Reject -- https://master.php.net/note/reject/124684 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#214001) next »