Re: Trying to read the value of a var...

From: Date: Sat, 10 May 2003 23:03:19 +0000
Subject: Re: Trying to read the value of a var...
References: 1 2  Groups: php.general 
Request: Send a blank email to php-general+get-147157@lists.php.net to get a copy of this message
Amanda McComb wrote: > I tried to figure out a way to use an array in this case, but I was > stumped. > > I would need something more like a hash, that would hold both the primary > key and a quantity. Does php have something like that? Is there a place > I can go to find an example? <?php if (isset($_POST['foo])){ while (list($key, $value) = each($_POST['foo'])){ echo "Key: $key value $value<BR>\n"; } } ?> <FORM METHOD=POST> <INPUT NAME=foo[12] VALUE="foo"> <INPUT NAME=foo[14] VALUE="bar"> <INPUT TYPE=SUBMIT> </FORM>

« previous php.general (#147157) next »