<?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, 'tabelle_mannschaft', 'tabelle_mannschaft'); foreach ($array as $i => $row) { if (isset($lookup[$row['tabelle_mannschaft']])) { $array[$i] = array_shift($subset); } } var_export($array);
You have javascript disabled. You will not be able to edit any code.