$input = array("color1"=>"red","color2"=> "green","color3"=>"blue","color4"=>"yellow"); array_splice($input,1,count($input),"orange"); echo '<pre>'.print_r($input,1).'</pre>';
Array ( [color1] => red [0] => orange )