php - create a hole in an array
517
I have an array of the form
$array = array(1 => 'a',
2 => 'b',
3 => 'c',
4 => 'd')
and I would like to create a 'hole' between 2 and 3, i.e. obtain the following array
$array = array(1 => 'a',
2 => 'b',
4 => 'c',
5 => 'd')
What do you reckon to be the best way to do this?
Answer
Solution:
This should work:
Answer
Solution:
Answer
Solution:
or the equivalent for version
Answer
Solution:
I want to join: http://codepad.org/9JDGHxhK
Answer
Solution:
Here is a tested complete solution:
Answer
Solution:
Output: