note 116710 added to function.array-rand
| From: | compolom at gmail dot com | Date: | Fri, 13 Feb 2015 16:17:13 +0000 |
| Subject: | note 116710 added to function.array-rand | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-201730@lists.php.net to get a copy of this message | ||
/*
useful function to sort an array randomly
*/
function sort_array_rand($array) {
$result = array();
$y = sizeof($array);
$x = 0;
while ($x < pow($y, 2)) {
$result[] = $array[array_rand($array)];
$x++;
}
return array_unique($result);
}
----
Server IP: 72.52.91.14
Probable Submitter: 31.192.145.177
----
Manual Page -- http://php.net/manual/en/function.array-rand.php
Edit -- https://master.php.net/note/edit/116710
Del: integrated -- https://master.php.net/note/delete/116710/integrated
Del: useless -- https://master.php.net/note/delete/116710/useless
Del: bad code -- https://master.php.net/note/delete/116710/bad+code
Del: spam -- https://master.php.net/note/delete/116710/spam
Del: non-english -- https://master.php.net/note/delete/116710/non-english
Del: in docs -- https://master.php.net/note/delete/116710/in+docs
Del: other reasons-- https://master.php.net/note/delete/116710
Reject -- https://master.php.net/note/reject/116710
Search -- https://master.php.net/manage/user-notes.php