kerbdog Posted February 19, 2011 Share Posted February 19, 2011 Hi Can some steer me in the right direction. I am having issues subtotaling 2 session variables: <td>'.$_SESSION['itemqty'][$key].'*'.$_SESSION['itemprice'][$key].'</td> Can you advise if I am doing this right? Cheers Link to comment https://forums.phpfreaks.com/topic/228162-session-variables/ Share on other sites More sharing options...
ale8oneboy Posted February 19, 2011 Share Posted February 19, 2011 The code you have provided would display the qty, an * and then the price. I believe you're looking for this: echo '<td>'.($_SESSION['itemqty'][$key] * $_SESSION['itemprice'][$key]).'</td>'; The difference is this code would compute the sub-total then display it. Hope that helps. Link to comment https://forums.phpfreaks.com/topic/228162-session-variables/#findComment-1176608 Share on other sites More sharing options...
kerbdog Posted February 19, 2011 Author Share Posted February 19, 2011 Thanks heaps, that helped alot..... Link to comment https://forums.phpfreaks.com/topic/228162-session-variables/#findComment-1176609 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.