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]);
}
}
}
}
$pp = array_values($kkk);
asort($kkk);
$yy = array(1=>$uno, 2=>$dos, 3=>$tres, 4=>$cuatro, 5=>$cinco, 6=>$seis, 7=>$siete, 8=>$ocho, 9=>$nueve, 10=>$diez, 11=>$once, 12=>$doce, 13=>$trece, 14=>$catorce, 15=>$quince, 16=>$diezseis, 17=>$diezsiete, 18=>$diezocho, 19=>$dieznueve, 20=>$veinte, 21=>$veinteuno, 22=>$veintedos, 23=>$veintetres, 24=>$veintecuatro, 25=>$veintecinco, 26=>$veinteseis, 27=>$veintesiete, 28=>$veinteocho, 29=>$veintenueve, 30=>$treinta, 31=>$treintauno, 32=>$treintados, 33=>$treintatres, 34=>$treintacuatro, 35=>$treintacinco, 36=>$treintaseis, 37=>$treintasiete, 38=>$treintaocho, 39=>$treintanueve, 40=>$cuarenta, 41=>$cuarentauno, 42=>$cuarentados, 43=>$cuarentatres, 44=>$cuarentacuatro, 45=>$cuarentacinco, 46=>$cuarentaseis, 47=>$cuarentasiete, 48=>$cuarentaocho, 49=>$cuarentanueve, 50=>$cincuenta);
echo "<table>";
foreach ($pp as $k1=>v1) {
foreach($yy as $k2=>v2){
if(v2==v1)
echo '<tr><td>$k2</td></tr>';
}
}
echo "</table>";
Me da este error expecting T_PAAMAYIM_NEKUDOTAYIM en esta línea foreach ($pp as $k1=>v1). No sé si $kkk está bien reindexado así $pp = array_values($kkk);