note 105973 added to function.array-splice
| From: | pritiatwork at gmail dot com | Date: | Thu, 29 Sep 2011 09:45:57 +0000 |
| Subject: | note 105973 added to function.array-splice | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-183518@lists.php.net to get a copy of this message | ||
/*Interestingly -0 offset also works !*/
$input = array("red", "green", "blue",
"yellow","marron","cyban");
$a=array_splice($input, -0,3);
print_r($a);
//$a prints to Array([0] => red,[1] => green,[2] => blue)
----
Server IP: 59.162.86.8
Probable Submitter: 121.242.40.10
----
Manual Page -- http://www.php.net/manual/en/function.array-splice.php
Edit -- https://master.php.net/note/edit/105973
Del: integrated -- https://master.php.net/note/delete/105973/integrated
Del: useless -- https://master.php.net/note/delete/105973/useless
Del: bad code -- https://master.php.net/note/delete/105973/bad+code
Del: spam -- https://master.php.net/note/delete/105973/spam
Del: non-english -- https://master.php.net/note/delete/105973/non-english
Del: in docs -- https://master.php.net/note/delete/105973/in+docs
Del: other reasons-- https://master.php.net/note/delete/105973
Reject -- https://master.php.net/note/reject/105973
Search -- https://master.php.net/manage/user-notes.php