3v4l.org

run code in 300+ PHP versions simultaneously
<?php $d = [ [ 'type' => 25500, 'month' => 'July' ], [ 'type' => 5465, 'month' => 'January' ], [ 'type' => 40000, 'month' => 'April' ], [ 'type' => 35000, 'month' => 'June' ], [ 'type' => 10000, 'month' => 'February' ] ]; $allMonths = ['January','February','March', 'April','May','June','July','August','September','October','November','December']; $currentMonths = array_column($d, 'month'); $notIncludedMonth = array_diff($allMonths,$currentMonths); foreach ($notIncludedMonth as $month) { $d[] = [ 'type' => 0, 'month' => $month, ]; } print_r($d);

preferences:
126.02 ms | 406 KiB | 5 Q