note 104367 added to function.array-slice
| From: | gary at wits dot sg | Date: | Sat, 11 Jun 2011 06:44:17 +0000 |
| Subject: | note 104367 added to function.array-slice | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-180431@lists.php.net to get a copy of this message | ||
I've found this useful.
The following is a function used to shuffle a very specific part of the array, by providing start
and end index.
function array_shuffle_section(&$a, $s, $e) {
$head = array_slice($a, 0, $s);
$body = array_slice($a, $s, $e-$s+1);
$tail = array_slice($a, $e+1);
shuffle($body);
$a = array_merge($head,$body,$tail);
}
----
Server IP: 202.79.181.100
Probable Submitter: 116.14.24.207
----
Manual Page -- http://www.php.net/manual/en/function.array-slice.php
Edit -- https://master.php.net/note/edit/104367
Del: integrated -- https://master.php.net/note/delete/104367/integrated
Del: useless -- https://master.php.net/note/delete/104367/useless
Del: bad code -- https://master.php.net/note/delete/104367/bad+code
Del: spam -- https://master.php.net/note/delete/104367/spam
Del: non-english -- https://master.php.net/note/delete/104367/non-english
Del: in docs -- https://master.php.net/note/delete/104367/in+docs
Del: other reasons-- https://master.php.net/note/delete/104367
Reject -- https://master.php.net/note/reject/104367
Search -- https://master.php.net/manage/user-notes.php