array_splice
array_splice — Remove a portion of the array and replace it with something else.Description
array_splice( array &$array,Removes the elements designated by offset and length from the array array, and replaces them with the elements of the replacement array, if supplied.
int $offset,
?int $length = null,
mixed $replacement = [] ): array
Parameters
array
The array to work on.
offset
The offset to start removing elements from.
length
The number of elements to remove. If not supplied, removes all elements from offset to the end of the array.
replacement
The elements to replace the removed elements with. If not supplied, replaces the removed elements with null.
Return Values
Returns an array consisting of the extracted elements.More information about array_splice on official PHP documentation site
array_splice - Popular snippets
- PHP 8.1 / MySQL 5.7 count array_merge array_splice rand print_r
last run:
2023-07-06 09:59:48
10
- PHP 8.0 / MySQL 5.7 array_splice var_dump
last run:
2021-08-11 07:13:40
8
- PHP 8.1 / MySQL 5.7 array_splice var_export
last run:
2022-12-17 18:14:02
7
- PHP 8.1 / MySQL 5.7 count array_merge array_splice rand print_r
last run:
2023-07-06 10:03:11
5
- PHP 8.1 / MySQL 5.7 count array_splice rand array_merge print_r
last run:
2022-12-05 19:07:36
4
- PHP 8.1 / MySQL 5.7 count array_merge array_splice rand print_r
last run:
2022-12-05 19:07:54
3
- PHP 8.0 / MySQL 5.7 range array_splice implode array_slice
last run:
2022-12-20 15:20:17
3
- PHP 7.4 / MySQL 5.7 explode array_merge array_splice print_r
last run:
2022-02-17 14:46:08
3
- PHP 8.0 / MySQL 5.7 print_r array_merge array_splice
last run:
2022-01-13 15:26:53
3
- PHP 8.1 / MySQL 5.7 count array_merge array_splice rand print_r
last run:
2022-12-05 19:04:18
2
array_splice - New snippets
-
PHP 8.1 / MySQL 5.7 array_splice var_dump
added at:
2023-10-06 09:58:37
1
-
PHP 8.1 / MySQL 5.7 array_splice var_dump
added at:
2023-10-06 09:58:30
1
-
PHP 8.1 / MySQL 5.7 array_splice var_dump
added at:
2023-10-06 09:58:20
1
-
PHP 8.1 / MySQL 5.7 array_splice var_dump
added at:
2023-10-06 09:58:00
1
-
PHP 8.1 / MySQL 5.7 count array_merge array_splice rand print_r
added at:
2023-07-06 10:03:00
1
-
PHP 8.1 / MySQL 5.7 count array_merge array_splice rand print_r
added at:
2023-07-06 10:02:39
5
-
PHP 8.1 / MySQL 5.7 array_splice implode preg_match count var_dump
added at:
2023-04-24 19:58:04
1
-
PHP 8.1 / MySQL 5.7 array_splice implode preg_match count var_dump
added at:
2023-04-24 19:57:39
1
-
PHP 8.1 / MySQL 8.0 json_decode var_dump count array_splice
added at:
2023-01-26 10:11:15
1
-
PHP 8.1 / MySQL 5.7 array_splice var_export
added at:
2022-12-17 14:51:16
7