You appear to be a bot. Output may be restricted
Description
Sort the rates array by ascending weight
Usage
$array = OIK_Shipping_Pro::sort_ascending( $rates_array );
Parameters
- $rates_array
- ( array ) required – array of rates
Returns
array sorted by ascending weight.Source
File name: oik-weightcountry-shipping-pro/class-oik-shipping-pro.phpLines:
1 to 21 of 21
function sort_ascending( $rates_array ) { $weights = array(); $rates = array(); //$group = array(); $labels = array(); foreach ( $rates_array as $key => $value ) { $weights[ $key ] = $value[0]; $rates[ $key ] = $value[1]; $labels[ $key ] = $value[3]; } //bw_trace2(); array_multisort( $weights, SORT_ASC, SORT_NUMERIC, $rates, $labels ); //bw_trace2( $weights, "weights", false ); //bw_trace2( $rates, "weights", false ); //bw_trace2( $labels, "labels", false ); foreach ( $weights as $key => $value ) { $new_array[] = array( $value, $rates[ $key ], null, $labels[ $key ] ); } return( $new_array ); }View on GitHub