note 87002 modified in function.array-slice by danbrown
| From: | danbrown@php.net | Date: | Fri, 14 Nov 2008 14:02:30 +0000 |
| Subject: | note 87002 modified in function.array-slice by danbrown | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-146523@lists.php.net to get a copy of this message | ||
Note that offset is not the same thing as key. Offset always starts at 0, while keys might be any
number.
So this:
<?php print_r(array_slice(array(0 => 0, 5 => 5, 13 => 13),1)); ?>
will result in this:
Array
(
[0] => 5
[1] => 13
)
--was--
Note that offset is not the same thing as key. Offset always starts at 0, while keys might be any
number.
So this:
print_r (array_slice(array(0 => 0, 5 => 5, 13 => 13),1));
will result in this:
Array
(
[0] => 5
[1] => 13
)
http://php.net/manual/en/function.array-slice.php