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 Quote Link to comment Share on other sites More sharing options...
teynon Posted June 2, 2011 Share Posted June 2, 2011 echo $defineProducts[6]['price']; Quote Link to comment 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. Quote Link to comment Share on other sites More sharing options...
erme Posted June 2, 2011 Author Share Posted June 2, 2011 Thanks Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.