Hi

Im new to OO PHP, been reading through my book and in one example they are using a class structure in a shopping cart. I have used session variables in the past for shopping carts, can I assume that if I create a class, which has a cart_contents array variable to which I add products, that the data will be accessible from page to page (like a session variable is accessible on all pages)...?

thanks
lworks

ok, so i kept reading and discovered that they are using the serialize() to convert that object into a value which is then stored in the $_SESSION variable... they do a check at the start of every page and if its already set, unserialize() the session cart...

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.