erme Posted June 2, 2011 Share Posted June 2, 2011 I had a simple shopping cart wrote for me. The products are defines like this: $defineProducts[6] = array(name=>'Bike with 4 Gears', price=>645); How can I echo the price? Many thanks Link to comment https://forums.phpfreaks.com/topic/238232-pulling-date-from-array/ Share on other sites More sharing options...
teynon Posted June 2, 2011 Share Posted June 2, 2011 echo $defineProducts[6]['price']; Link to comment https://forums.phpfreaks.com/topic/238232-pulling-date-from-array/#findComment-1224274 Share on other sites More sharing options...
WebStyles Posted June 2, 2011 Share Posted June 2, 2011 you can also add formatting: echo number_format($defineProducts[6]['price'],2,".",","); check out http://pt.php.net/manual/en/function.number-format.php for other formatting options. Link to comment https://forums.phpfreaks.com/topic/238232-pulling-date-from-array/#findComment-1224278 Share on other sites More sharing options...
erme Posted June 2, 2011 Author Share Posted June 2, 2011 Thanks Link to comment https://forums.phpfreaks.com/topic/238232-pulling-date-from-array/#findComment-1224290 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.