note 67085 added to function.array-unshift
| From: | JohnBrooking at osu1 dot php dot net | Date: | Sat, 03 Jun 2006 01:54:23 +0000 |
| Subject: | note 67085 added to function.array-unshift | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-113047@lists.php.net to get a copy of this message | ||
I had a need tonight to convert a numeric array from 1-based to 0-based, and found that the
following worked just fine due to the "side effect" of renumbering:
array_unshift( $myArray, array_shift( $myArray ));
----
Server IP: 66.163.161.117
Probable Submitter: 24.39.14.232
----
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-unshift.php
Edit -- http://master.php.net/note/edit/67085
Del: integrated -- http://master.php.net/note/delete/67085/integrated
Del: useless -- http://master.php.net/note/delete/67085/useless
Del: bad code -- http://master.php.net/note/delete/67085/bad+code
Del: spam -- http://master.php.net/note/delete/67085/spam
Del: non-english -- http://master.php.net/note/delete/67085/non-english
Del: in docs -- http://master.php.net/note/delete/67085/in+docs
Del: other reasons-- http://master.php.net/note/delete/67085
Reject -- http://master.php.net/note/reject/67085
Search -- http://master.php.net/manage/user-notes.php