note 99989 added to function.array-slice
| From: | rayro at gmx dot de | Date: | Sat, 18 Sep 2010 11:20:14 +0000 |
| Subject: | note 99989 added to function.array-slice | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-172709@lists.php.net to get a copy of this message | ||
Think that theres something missing in the doc. It says "If it is omitted, then the sequence
...", but how it can be omitted?
Say, you want to use $offset but no $length AND want to $preserve_keys, so use NULL to skip this
param:
<?php
$arr = array('Cat','Dog','Ape','Sheep','Fly');
var_dump(array_slice($arr,2,null,true));
?>
will output:
array(3) {
[2]=>
string(3) "Ape"
[3]=>
string(5) "Sheep"
[4]=>
string(3) "Fly"
}
----
Server IP: 69.147.83.197
Probable Submitter: 79.226.191.185
----
Manual Page -- http://www.php.net/manual/en/function.array-slice.php
Edit -- https://master.php.net/note/edit/99989
Del: integrated -- https://master.php.net/note/delete/99989/integrated
Del: useless -- https://master.php.net/note/delete/99989/useless
Del: bad code -- https://master.php.net/note/delete/99989/bad+code
Del: spam -- https://master.php.net/note/delete/99989/spam
Del: non-english -- https://master.php.net/note/delete/99989/non-english
Del: in docs -- https://master.php.net/note/delete/99989/in+docs
Del: other reasons-- https://master.php.net/note/delete/99989
Reject -- https://master.php.net/note/reject/99989
Search -- https://master.php.net/manage/user-notes.php