SpecialFighter
Mitglied
wenn doch so oder?
PHP:
$itemIds = array_column($_SESSION['inventar'], 'Item_ID');
foreach($zufall_items as $idx => $zufallsItem){
if(in_array($zufallsItem, $itemIds)){
$_SESSION['inventar'][$idx]['Anzahl']++;
}else{
$_SESSION['inventar'][] = array('Item_ID' => $zufallsItem, 'Anzahl' => 1, 'Level' => 0);
}
}