Remove elements from an array and replace it with new elements:
<?php
$a1=array("a"=>"red","b"=>"green","c"=>"blue","d"=>"yellow");
$a2=array("a"=>"purple","b"=>"orange");
array_splice($a1,0,2,$a2);
print_r($a1);
?>
by გიორგი ბაკაშვილი
4 years ago
PHP
Array
PHP official doc
1
Pro tip: use ```triple backticks around text``` to write in code fences