array_splice
array array_splice(array array, int offset, [int length], [array replacement])
array | Array to act on |
offset | Starting element index |
length | Length of segment to replace |
replacement | Array of replacement elements |
Replaces part of an array with another array.
Returns:
Array of elements deleted from the original array; NULL on failure
Description:
This function deletes the elements of array starting at the position given by offset . If offset is positive, it gives the number of elements from the beginning of array from which to start deleting; if negative, it gives the number of elements from the end at which to start deleting.
array is altered in place, and an array containing the deleted elements is returned.
If length is given ...
Get PHP Functions Essential Reference now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.