that's a matter of style
assuming you have a multidimensional array
foreach method:
<?php
foreach(array_keys($cart) as $id) {
//print each element referring to the elements
//as $cart[$id]['item'];
} //end foreach
?>
assuming you have a multidimensional array
current --> next method
<?php
while(current($cart) !== false) {
$cur_item = current($cart):
//print each element referring to the elements
//as $cur_item['item']
next($cart);
} //end while
reset($cart);
I'd use the first method, I think it's less overhead.