Contact: aviboots(AT)netvision.net.il
41,379 questions
53,922 answers
573 users
$array = [4, 9, 8, 6, 5, 7]; $index = 2; $element = 100; // Insert the element at the specified index array_splice($array, $index, 0, $element); print_r($array); /* run: Array ( [0] => 4 [1] => 9 [2] => 100 [3] => 8 [4] => 6 [5] => 5 [6] => 7 ) */