Say you have a 10 element indexed array and you want to place an element somewhere in the middle (say index 3). Then I want to have the rest of the array shift and thus be 11 elements long. Is there an easy way to do this?
I am surprised there is no put()
function or something.
I know it would be easy enough to do this with a combination of array_splice
and array_merge
but I was just wondering if there an easier way.