Using array_filter besides foreach loop