Ver Mensaje Individual
  #1 (permalink)  
Antiguo 07/06/2012, 12:53
alex760125
 
Fecha de Ingreso: enero-2010
Mensajes: 239
Antigüedad: 14 años, 3 meses
Puntos: 0
Array dentro de loop for

Código PHP:
$kkk = array($uno$dos$tres$cuatro$cinco$seis$siete$ocho$nueve$diez$once$doce$trece$catorce$quince$diezseis$diezsiete$diezocho$dieznueve$veinte$veinteuno$veintedos$veintetres$veintecuatro$veintecinco$veinteseis$veintesiete$veinteocho$veintenueve$treinta$treintauno$treintados$treintatres$treintacuatro$treintacinco$treintaseis$treintasiete$treintaocho$treintanueve$cuarenta$cuarentauno$cuarentados$cuarentatres$cuarentacuatro$cuarentacinco$cuarentaseis$cuarentasiete$cuarentaocho$cuarentanueve$cincuenta);

foreach (
$kkk as $k1 => $v1) {
    foreach (
$kkk as $k2 => $v2) {
        if (
$k1 != $k2) {
            if (
$v1 == $v2) {
                unset(
$kkk[$k1]);
            }
        }
    }
}

asort($kkk);

$conk count($kkk);

echo 
"<table><tr>";

for (
$i=0$i<$conk$i++)
{
echo 
"<td>";

echo 
$kkk[$i];

echo 
"</td>";

}

echo 
"</tr></table>"
Necesito ayuda, no sé por qué me sale Undefined offset en esta línea echo $kkk[$i];. Las variables del array tienen valores pasados mediante POST.