note 90285 added to function.array-slice
| From: | fixwah at gmail dot com | Date: | Tue, 14 Apr 2009 19:36:33 +0000 |
| Subject: | note 90285 added to function.array-slice | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-153215@lists.php.net to get a copy of this message | ||
In the SPANISH versión of this manual, the example has a wrong variable name on the $salida var.
It should be:
<?php
$entrada = array("a", "b", "c", "d", "e");
$salida = array_slice($entrada, 2); // regresa "c", "d", and "e"
$salida = array_slice($entrada, -2, 1); // regresa "d"
$salida = array_slice($entrada, 0, 3); // regresa "a", "b", and "c"
// note la diferencias en las Ãndices
print_r(array_slice($entrada, 2, -1));
print_r(array_slice($entrada, 2, -1, true));
?>
----
Server IP: 69.147.83.197
Probable Submitter: 190.3.69.114
----
Manual Page -- http://www.php.net/manual/en/function.array-slice.php
Edit -- https://master.php.net/note/edit/90285
Del: integrated -- https://master.php.net/note/delete/90285/integrated
Del: useless -- https://master.php.net/note/delete/90285/useless
Del: bad code -- https://master.php.net/note/delete/90285/bad+code
Del: spam -- https://master.php.net/note/delete/90285/spam
Del: non-english -- https://master.php.net/note/delete/90285/non-english
Del: in docs -- https://master.php.net/note/delete/90285/in+docs
Del: other reasons-- https://master.php.net/note/delete/90285
Reject -- https://master.php.net/note/reject/90285
Search -- https://master.php.net/manage/user-notes.php