I'm very new to PHP
and I found a problem which I can't find much information, something that I really understand or that helps me for my level; I have two FOREACH (Which I have never used in another language), these print a table in HTML
and I need to completely ignore the last field (I WANT ALL THE DATA TO BE DISPLAYED EXCEPT THE LAST OF EACH CYCLE ["G.Img"] ) ; I have tried the CONTINUE; but really the problem is the If , it doesn't work for me with anything; I have tried too many ways.
HERE I LEAVE MY LITTLE CODE WITHOUT WORKING:
<?php
foreach($paises As $x){
//DEBERÍA IGNORAR EL ÚLTIMO DATO Y SEGUIR EL CICLO
//INTENTO FALLIDO:
if(array_keys($x) == 6){
echo "Entró";
continue;
}
foreach($x As $x1){
//CÓDIGO PARA IMPRIMIR LOS DATOS INTERNOS DE LOS PAÍSES.
//-------------
//-------------
}
}?>
I also attach the shape of my associative arrays:
$paises = array(
"Chile" => array(
"Bandera" => "<img src='../SOURCES/cl.png'>",
"Nombre" => "República de Chile",
"Moneda" => "CLP",
"Comida" => "Ajiaco","Chorillana","Sopaipillas",
"G. Img" => "<img src='1.png'>", "<img src='1.png'>", "<img src='1.png'>"
),
"Japón" => array(
"Bandera" => "<img src='../SOURCES/jp.png'>",
"Nombre" => "Estado del Japón",
"Moneda" => "YEN",
"Comida" => "Ramen","Onigiri","Yakitori",
"G. Img" => "<img src='1.png'>", "<img src='1.png'>", "<img src='1.png'>"
);
Thanks in advance :( !