Given 2 associative arrays:
$fruits = array ( \"d\" => \"lemon\", \"a\" => \"orange\", \"b\" => \"banana\", \"c\" => \"apple\" ); $fruits2 = array
Got it working this way :
$n = count($fruits); for ( $i = 0; $i < $n; $i++) { $cur_vals_1 = each ($fruits); $cur_vals_2 = each ($fruits2); $sum1 += $cur_vals_1['key'] * $cur_vals_1['value']; ... }