- var_dump: documentation ( source)
- array_keys: documentation ( source)
- min: documentation ( source)
<?php
$arr1 = [
0 => "test zero",
1 => "test one",
2 => "test two",
3 => "test three"
];
$arr2 = [
1 => "test four",
5 => "test five",
3 => "test six",
4 => "test seven"
];
$i=min(array_keys($arr1));
foreach($arr2 as $k=>$val)
{
if(array_key_exists($k,$arr1))
{
$arr1[$k].='\N, '.$val;
}
}
var_dump($arr1);