note 69329 added to function.array-splice
| From: | bdjumakov at gmail dot com | Date: | Thu, 31 Aug 2006 19:11:48 +0000 |
| Subject: | note 69329 added to function.array-splice | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-116562@lists.php.net to get a copy of this message | ||
Someone might find this function usefull. It just takes a given element from the array and moves it
before given element into the same array.
<?php
function array_move($which, $where, $array)
{
$tmp = array_splice($array, $which, 1);
array_splice($array, $where, 0, $tmp);
return $array;
}
?>
----
Server IP: 195.149.248.161
Probable Submitter: 85.91.139.84
----
X-Spam-Status: No, hits=3.1 required=5.0 tests=DATE_MISSING,FROM_NO_LOWER
autolearn=no version=2.64
----
Manual Page -- http://www.php.net/manual/en/function.array-splice.php
Edit -- https://master.php.net/note/edit/69329
Del: integrated -- https://master.php.net/note/delete/69329/integrated
Del: useless -- https://master.php.net/note/delete/69329/useless
Del: bad code -- https://master.php.net/note/delete/69329/bad+code
Del: spam -- https://master.php.net/note/delete/69329/spam
Del: non-english -- https://master.php.net/note/delete/69329/non-english
Del: in docs -- https://master.php.net/note/delete/69329/in+docs
Del: other reasons-- https://master.php.net/note/delete/69329
Reject -- https://master.php.net/note/reject/69329
Search -- https://master.php.net/manage/user-notes.php