Re: Simple Array question (conclusion)
| From: | Ryan A | Date: | Tue, 29 Jul 2003 23:18:37 +0000 |
| Subject: | Re: Simple Array question (conclusion) | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-157464@lists.php.net to get a copy of this message | ||
I GOT IT!!!!
this is where the data was coming from:
<input name="id[sh123]" type="hidden" id="id[sh123]"
value="32">
<input name="id[sh1sd]" type="hidden" id="id[sh1sd]"
value="563">
and this is where i take the values and dump it into an array/variables that
i can call when and where i please:
<?php
$nn=0;
foreach($id as $nname => $pppno)
{$asdf[$nn]=$pppno;
$nn++; }
?>
<br><br><?php echo $asdf[0]; ?><br>
<?php echo $asdf[1]; ?>
I just took out some of the breaks so it will take less space but you get
the idea.
Thank you to everyone who tried to help, but maybe i didnt explain the
problem well enough that you didnt get the answer or just didnt want to :-D
Cheers,
-Ryan
----- Original Message -----
From: "Irvin Amoraal" <irvin@cabletv.on.ca>
To: <php-general@lists.php.net>
Sent: Tuesday, July 29, 2003 11:59 PM
Subject: [PHP] Re: Simple Array question
> Normally array values start at 0 (zero), but let's say sh1=1 and sh2=2.
then
> you could echo the values out like this: echo "ID 1: $id[1]<br>ID 2:
> $id[2]<br>";
>
> Irvin.
> _____________________________________
>
> "Ryan A" <ryan@jumac.com> wrote in message
> news:002f01c355f4$0e3b3bd0$f081aa51@l2zcaxu7emppqh...
> > Hi,
> > If i am posting something like this from a form:
> > <input type=checkbox name='id[sh1]' value=3>
> > <input type=checkbox name='id[sh2]' value=4>
> >
> > How do i get the value of id[]?
> > eg:
> > I dont want the "sh1" and "sh2", i just want the "3" and
> > "4"
> >
> > The reason i dont wan the sh1 and sh2 is those are dynamic and will be
> > changing, I just need the values (in this case 3 and 4) to do some
> > comparasion and assignment operations
> >
> > Kindly reply.
> >
> > Thank,
> > -Ryan
> >
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>