3v4l.org

run code in 300+ PHP versions simultaneously
<?php $records = [ [ "Id" => 151601, "First_name" => "John", "Positions" => [ "North" => [ "Current_Level" => 4, "Last_Date" => "11/7/2001", "Time" => "4:15 AM" ], "East" => [ "Current_Level" => 4, "Last_Date" => "7/10/2003", "Time" => "7:30 PM" ], "South" => [ "Current_Level" => 2, "Last_Date" => "8/10/2007", "Time" => "NA" ], "West" => [ "Current_Par_Level" => "NA", "Last_Date" => "NA", "Time" => "NA" ], ] ] ]; foreach ($records as $keyRecord => $record) { foreach ($record as $key => $value) { if (is_array($value)) { foreach ($value as $keyPosition => $position) { if ($position["Time"] == "NA") { unset($records[$keyRecord][$key][$keyPosition]); } } } } } print_r($records);

preferences:
82.55 ms | 1659 KiB | 5 Q