Wrox Programmer Forums
BOOK: Professional CodeIgniter ISBN: 978-0-470-28245-8
This is the forum to discuss the Wrox book Professional CodeIgniter by Thomas Myer; ISBN: 9780470282458
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Professional CodeIgniter ISBN: 978-0-470-28245-8 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
Old January 13th, 2010, 06:59 AM
Authorized User
Join Date: Jan 2010
Posts: 12
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to mehdymahmood
Default need explaination

hello ,
im confused ., i need explanation , please help out , its in chapter 5 ,

function updateCart($productid,$fullproduct){
//pull in existing cart first!
$cart = $_SESSION['cart'];//$this->session->userdata('cart');
$productid = id_clean($productid);
$totalprice = 0;
if (count($fullproduct)){
if (isset($cart[$productid])){
$prevct = $cart[$productid]['count'];
$prevname = $cart[$productid]['name'];
$prevprice = $cart[$productid]['price'];
$cart[$productid] = array(
'name' => $prevname,
'price' => $prevprice,
'count' => $prevct + 1
$cart[$productid] = array(
'name' => $fullproduct['name'],
'price' => $this->format_currency($fullproduct['price']),
'count' => 1

i dont understand where 'cart' get value and what will be the output of this multidimensional array , please help me understand,

Similar Threads
Thread Thread Starter Forum Replies Last Post
Need new Explaination for Installing PHP5.3, Page10-11. SlimShady BOOK: Beginning PHP 6, Apache, MySQL 6 Web Development ISBN: 9780470391143 4 September 15th, 2009 10:18 PM

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.