[ create a new paste ] login | about

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

PHP, pasted on Jan 9:
1
2
3
4
5
6
7
8
9
10
11
<?php

$sample = array(
   'test',
   'test1',
   'test2',
);

array_splice($sample, 1, 0, array( 'test4', 'test5' ));

var_dump( $sample );


Output:
1
2
3
4
5
6
7
8
9
10
11
12
array(5) {
  [0]=>
  string(4) "test"
  [1]=>
  string(5) "test4"
  [2]=>
  string(5) "test5"
  [3]=>
  string(5) "test1"
  [4]=>
  string(5) "test2"
}


Create a new paste based on this one


Comments: