Array ( [0] => Array ( [totalprice] => 671 [total] => 0 [price_per_p] => 2 ) [1] => Array ( [totalprice] => 312 [total] => 0 [price_per_p] => 2 ) )
Trying to get "totalprice" from each array.
$i = 0;
foreach($arr as $x_values => $x) {
echo $x[$i]["totalprice"];
$i++;
}
But this doesn't work at all.
$arr = array(
array(
"totalprice" => "671",
"total" => "0",
"price_per_p" => 2,
),
array(
"totalprice" => "312",
"total" => "0",
"price_per_p" => 2,
)
);
I'd like to get from array 1 at first "loop" and array 2 at second "loop"