RE: [PHP-ES] Array asociativo

From: Date: Thu, 13 Nov 2003 19:06:34 +0000
Subject: RE: [PHP-ES] Array asociativo
References: 1  Groups: php.general.es 
Request: Send a blank email to general-es+get-42557@lists.php.net to get a copy of this message
Hola, Y si en vez de: > <input type="hidden" name="IDtit["121"][] value="1"> ocupas > <input type="hidden" name="IDtit[]["121"] value="1"> Y haces un count de IDtit? El count devuelve la cardinalidad de la primera "dimension" del arreglo Saludos Eugenio Dapena Camprubi -----Mensaje original----- De: MiKairos [mailto:sguamanb@hotmail.com] Enviado el: Jueves, 13 de Noviembre de 2003 13:32 Para: lista@phpes.com Asunto: 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. > --------------------------------------------------------------------- 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

« previous php.general.es (#42557) next »