= 250) && ($load_dim_1 >= 500) ){ // Add std lost load $load_weight + 650; // $forklift_std_lc = ['default' => 600, 'lc' => [ 2000 => 700, 3000 => 800, 4000 => 900, 5000 => 1000, 6000 => 1100, 7000 => 1200, ],]; // Sort lookup array uasort($forklift_std_lc['lc'], function($a, $b) { if ($a == $b) { return 0; } return ($a > $b) ? -1 : 1; }); // Assign default value, then check if above array $lc = $forklift_std_lc['default']; foreach( $forklift_std_lc['lc'] as $min => $v ) { if( $load_weight >= $min ) { $lc = $v; } } $load_max_dim = ( $load_dim_1 / 2 ) + 400; $multiplier = ( $load_max_dim / $lc ) > 1 ? $load_max_dim / $lc : 1; $capacity = number_format(500 * ceil( ( $load_weight * $multiplier ) / 500 )); } $canonical = $baseurl . '/load-calculator/'; require_once(__DIR__ . '/templates/tpl-load-calculator.php');