<?php $shipArr = [ [ 'ship_cost' => '1', 'country_id' => '1', 'country_code' => 'US', 'country_name' => 'United States', ], [ 'ship_cost' => '0', 'country_id' => '0', 'country_code' => '', 'country_name' => false, ] ]; $user_country_id = 1; var_export( array_find( $shipArr, fn($row) => $row['country_id'] == $user_country_id )['ship_cost'] ?? 0 );
You have javascript disabled. You will not be able to edit any code.