Re: Array asociativo
| From: | Jorge Vásquez | Date: | Thu, 13 Nov 2003 17:04:19 +0000 |
| Subject: | Re: Array asociativo | ||
| References: | 1 2 3 | Groups: | php.general.es |
| Request: | Send a blank email to general-es+get-42547@lists.php.net to get a copy of this message | ||
Hola MiKairos,
Gracias por tu respuesta pero el problema tampoco es ese, ya que para hacer
la prueba he introducido los indices manualmente y me funciono muy bien, asi
que no es problema de comillas.
Manuel, también probe con un FOREACH y me recorre bien el número de la
cuenta pero el del IDtit no lo hace para nada. Lo estoy haciendo de esta
forma con el FOREACH
foreach($cuenta as $c)
{
echo $c."<br>";
foreach ($IDtit[$c] as $t)
{
echo $t."<br>";
}
}
Y el resultado que obtengo es:
121
1
2
2
122
1
2
2
121
1
2
2
122
1
2
2
Salu2 y gracias a todos por su ayuda.
Jorge.
----- Original Message -----
From: "MiKairos" <sguamanb@hotmail.com>
To: <lista@phpes.com>
Sent: Thursday, November 13, 2003 10:31 AM
Subject: Re: [PHP-ES] Array asociativo
> puede que esto te esté afectando
> <input type="hidden" name="IDtit["121"][] value="1">
> no debería ser así?
>
> <input type="hidden" name="IDtit['121'][]"
> value="1">
> o
> <input type="hidden" name='IDtit["121"][]'
> value="1">
>
> "Jorge vásquez" <jvasquez@smarketing.com.sv> escribió en el mensaje
> news:00e801c3a971$31aa7880$01264309@server...
> > Upppppp.. perdon.. habia un error en los checkbox, aqui estan los
> correctos
> > <input type="checkbox" name="cuenta[]" value="121">
> > <input type="hidden" name="IDtit["121"][]
> > value="1">
> > <input type="checkbox" name="cuenta[]" value="122">
> > <input type="hidden" name="IDtit["122"][]
> > value="1">
> > <input type="checkbox" name="cuenta[]" value="121">
> > <input type="hidden" name="IDtit["121"][]
> > value="2">
> > <input type="checkbox" name="cuenta[]" value="122">
> > <input type="hidden" name="IDtit["122"][]
> > value="2">
> >
> > Para recorrer la cuenta lo hago de la siguiente forma:
> > for($i=0;$i<sizeof($cuenta);$i++)
> > {
> > echo $cuenta[$i]."<br>";
> > }
> > El problema resulta cuando quiero recorrer el IDtit, si utilizo $i como
> > indice no me funciona porque $i vale 4 y el indice de $IDtit es
solamente
> 2.
> >
> > Gracias por su ayuda.