Anytime I use arrays I use what John suggested but add <pre></pre> around
it.  If you do that then the array becomes very clear.

echo "<pre>", print_r($_SESSION), "</pre>";



-----Original Message-----
From: Jason Wong [mailto:[EMAIL PROTECTED]]
Sent: June 27, 2002 12:44 AM
To: [EMAIL PROTECTED]
Subject: Re: [PHP] More on removing item from cart


On Thursday 27 June 2002 10:52, Analysis & Solutions wrote:
> Hey Vicki:
>
> On Wed, Jun 26, 2002 at 11:01:31AM -0400, Vicki wrote:
> > I'm checking the cart structure by printing the following code inserted
> > right after the "if($save);"
> > line (is this the best way to check on the contents of an array?)
> >
> > while (list($key,$value) = each($cart))
> >    {
> >       print "Cart = $key: $value<BR>";
> >    }
> >
> > This returns "article ID number (an integer) : 1" when new
> > and "article ID : yes" after the save button has been clicked.

The easiest way to print out any variable is to use print_r() or var_dump().

--
Jason Wong -> Gremlins Associates -> www.gremlins.com.hk
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *

/*
You will forget that you ever knew me.
*/


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to