<?php $array = [ ['tabelle_mannschaft' => 'SV Winter'], ['tabelle_mannschaft' => 'Mannschaft 7'], ['tabelle_mannschaft' => 'TSV HORIZONT'], ['tabelle_mannschaft' => 'Mannschaft 8'], ]; $subset = [ ['tabelle_mannschaft' => 'TSV HORIZONT'], ['tabelle_mannschaft' => 'Mannschaft 7'], ]; $lookup = array_column($subset, null, 'tabelle_mannschaft'); foreach ($array as &$row) { $row = $lookup[$row['tabelle_mannschaft']] ?? array_shift($subset); } var_export($array);
You have javascript disabled. You will not be able to edit any code.