tags:

views:

31

answers:

2
array array_splice  ( array &$input  , int $offset  [, int $length = 0  [, mixed $replacement  ]] )

Why is there an & before $input?

+6  A: 

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.

mabwi
+2  A: 

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.

Tom