array array_splice ( array &$input , int $offset [, int $length = 0 [, mixed $replacement ]] )
Why is there an & before $input?
array array_splice ( array &$input , int $offset [, int $length = 0 [, mixed $replacement ]] )
Why is there an & before $input?
That means the $input array is passed by reference, so any changes made in the function affect that array. The default behaviour is to pass a copy, so changes made inside the function don't affect the original.
The & indicates that this is a reference, i.e. the array is not copied and any changes to input
made by array_splice
will be reflected in the input array. See the PHP reference for more details.