← All docs

array_splice()

Removes a portion of the array and replaces it with something else.

array_splice()

function array_splice(array $array, int $offset, int $length = null): array

Removes a portion of the array and replaces it with something else.

Parameters:

  • $array (array), passed by reference
  • $offset (int)
  • $length (int), default null, optional

Returns: array

No examples yet — check examples/ and showcases/ for usage patterns.

Internals

For how array_splice is implemented in the compiler, see the internals page.