[ create a new paste ] login | about

Link: http://codepad.org/9JDGHxhK    [ raw code | output | fork ]

PHP, pasted on Nov 8:
1
2
3
4
5
6
7
8
9
10
11
<?php
$array = array(1 => 'a',
               2 => 'b',
               3 => 'c',
               4 => 'd');

array_splice($array, 2, 0, "");

$new_array = array_filter($array);

print_r($new_array);


Output:
1
2
3
4
5
6
7
Array
(
    [0] => a
    [1] => b
    [3] => c
    [4] => d
)


Create a new paste based on this one


Comments: