Re: Array asociativo
| From: | jm aribau | Date: | Thu, 13 Nov 2003 04:36:42 +0000 |
| Subject: | Re: Array asociativo | ||
| References: | 1 2 | Groups: | php.general.es |
| Request: | Send a blank email to general-es+get-42507@lists.php.net to get a copy of this message | ||
for ($i = 0 ; $i < count($cuenta) ; $i++) {
echo $cuenta[$i]."<br>";
for ($j = 0 ; $j count ($IDtit[$cuenta[$i]]) ; $j++) {
echo $IDtit[$cuenta[$i]][$j]."<br>";
}
}
No esta comprovado, hecho on-time.
Josep Ma. Aribau Cano
----- Original Message -----
From: "Jorge Vásquez" <jvasquez@smarketing.com.sv>
To: <lista@phpes.com>
Sent: Thursday, November 13, 2003 12:03 AM
Subject: Re: [PHP-ES] Array asociativo
> 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.
>
>
> ---------------------------------------------------------------------
> Archivo On-line: http://www.phpes.com/
> via news: news://news.phpes.com/
> Manual PHP en español: http://www.php.net/manual/es/
> Para dar de baja la suscripción, mande un mensaje a:
> lista-unsubscribe@phpes.com