Morty222 Posted October 8, 2008 Share Posted October 8, 2008 I have this is the session: foreach ($_SESSION['cart'] as $key=>$c){ $total = $_SESSION['cart'][$key]['cost']; } This gives me a total for each product, works fine. How can I add the totals together to get a grand total? Thanks in advance !!!! Link to comment https://forums.phpfreaks.com/topic/127485-solved-php-session-help/ Share on other sites More sharing options...
trq Posted October 8, 2008 Share Posted October 8, 2008 $total += $_SESSION['cart'][$key]['cost']; Link to comment https://forums.phpfreaks.com/topic/127485-solved-php-session-help/#findComment-659568 Share on other sites More sharing options...
Morty222 Posted October 8, 2008 Author Share Posted October 8, 2008 Thanks, worked great. Link to comment https://forums.phpfreaks.com/topic/127485-solved-php-session-help/#findComment-659571 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.