$arr = [0 => 'Petya', 1 => 'Vasya', 2 => 'Kolya', 3 =>'Gene', 4 =>'Jenya'];
for ($i = 0, $count = count($arr); $i < $count; $i++) {
switch ($i) {
case 3:
echo $i. $arr[$i], "Сидоров", "<br>";
case $i:
echo $i. $arr[$i], "Иванов", "<br>";
}