array_slice
array_slice — Extract a slice of the array.Description
array_slice( array $array,array_slice() returns the sequence of elements from the array array as specified by the offset and length parameters.
int $offset,
?int $length = null,
bool $preserve_keys = false ): array
Parameters
array
The input array.
offset
The offset to start from.
length
The length of the slice.
preserve_keys
Whether or not to preserve keys.
Return Values
Returns the slice. If the offset is larger than the size of the array, an empty array is returned.More information about array_slice on official PHP documentation site
array_slice - Popular snippets
- PHP 8.1 / MySQL 5.7 array_slice array_search min array_sum var_dump
last run:
2023-06-22 16:50:10
11
- PHP 8.1 / MySQL 5.7 print_r array_slice
last run:
2022-08-05 03:47:45
7
- PHP 8.1 / MySQL 5.7 str_split shuffle print_r array_slice
last run:
2022-11-12 16:29:07
5
- PHP 7.4 / MySQL 5.7 shuffle print_r array_slice
last run:
2022-07-02 09:05:31
5
- PHP 7.4 / MySQL 8.0 array_slice array_unique array_reverse print_r
last run:
2022-11-28 09:51:39
5
- PHP 8.1 / MySQL 5.7 explode implode array_slice
last run:
2022-12-26 09:11:44
4
- PHP 8.1 / MySQL 5.7 parse_url implode array_slice explode print_r
last run:
2022-10-11 14:01:55
4
- PHP 8.1 / MySQL 5.7 array_slice print_r
last run:
2022-06-27 12:21:38
4
- PHP 8.1 / MySQL 5.7 shuffle array_slice print_r
last run:
2022-05-14 15:44:15
4
- PHP 8.0 / MySQL 5.7 explode array_slice implode var_export
last run:
2023-05-17 05:58:48
4
array_slice - New snippets
-
PHP 8.1 / MySQL 5.7 array_slice key reset
added at:
2023-06-27 12:16:37
3
-
PHP 8.1 / MySQL 5.7 array_slice key reset
added at:
2023-06-27 12:13:57
1
-
PHP 8.1 / MySQL 5.7 array_slice key reset
added at:
2023-06-27 12:13:48
1
-
PHP 8.1 / MySQL 5.7 print_r array_slice key reset
added at:
2023-06-27 12:13:33
1
-
PHP 8.1 / MySQL 5.7 print_r array_slice
added at:
2023-06-27 12:11:44
1
-
PHP 8.1 / MySQL 5.7 print_r array_slice
added at:
2023-06-27 12:11:39
1
-
PHP 8.1 / MySQL 5.7 print_r array_slice
added at:
2023-06-27 12:11:20
1
-
PHP 8.1 / MySQL 5.7 range array_slice array_search min array_sum var_dump
added at:
2023-06-22 17:49:22
1
-
PHP 8.1 / MySQL 5.7 range array_slice array_search min array_sum var_dump
added at:
2023-06-22 17:49:05
1
-
PHP 8.1 / MySQL 5.7 range array_slice array_search min array_sum var_dump
added at:
2023-06-22 17:48:58
1