<html>
<head>
<meta charset="UTF-8">
<title>practica calificada</title>
<h1> LITADO DE MESES</h1>
</head>
<body>
<?php
// put your code here
$meses = array("MES"=>"DIAS","Enero"=>"31","Febrero"=>"28","Marzo"=>"31","Abril"=>"30","Mayo"=>"31","Junio"=>"30","Julio"=>"31"
,"Agosto"=>"31","Septiembre"=>"30","Octubre"=>"31","Noviembre"=>"30","Diciembre"=>"31");
foreach($meses as $mes=>$dias)
{
echo "$mes $dias <br>";
}
?>
</body>
</html>
<html>
<head>
<meta charset="UTF-8">
<title>practica calificada</title>
<h1> LITADO DE MESES</h1>
</head>
<body>
<table border=1>
<?php
// put your code here
$meses = array("MES"=>"DIAS","Enero"=>"31","Febrero"=>"28","Marzo"=>"31","Abril"=>"30","Mayo"=>"31","Junio"=>"30","Julio"=>"31"
,"Agosto"=>"31","Septiembre"=>"30","Octubre"=>"31","Noviembre"=>"30","Diciembre"=>"31");
foreach($meses as $mes=>$dias)
{
echo "<tr>";
echo "<td>$mes</td><td>$dias</td>";
echo "</tr>";
}
?>
</table>
</body>
</html>
<html>
<head>
<meta charset="UTF-8">
<title>practica calificada</title>
<h1> LITADO DE MESES</h1>
</head>
<body>
<table border=1>
<?php
// put your code here
$meses = array("MES"=>"DIAS","Enero"=>"31","Febrero"=>"28","Marzo"=>"31","Abril"=>"30","Mayo"=>"31","Junio"=>"30","Julio"=>"31"
,"Agosto"=>"31","Septiembre"=>"30","Octubre"=>"31","Noviembre"=>"30","Diciembre"=>"31");
foreach($meses as $mes=>$dias) {
?>
<tr>
<td><?php echo $mes; ?></td>
<td><?php echo $dias; ?></td>
</tr>
<?php
}
?>
</table>
</body>
</html>
<html>
<head>
<meta charset="UTF-8">
<title>practica calificada</title>
<h1> LITADO DE MESES</h1>
</head>
<body>
<table border=1>
<?php
// put your code here
$meses = array("MES"=>"DIAS","Enero"=>"31","Febrero"=>"28","Marzo"=>"31","Abril"=>"30","Mayo"=>"31","Junio"=>"30","Julio"=>"31"
,"Agosto"=>"31","Septiembre"=>"30","Octubre"=>"31","Noviembre"=>"30","Diciembre"=>"31");
foreach($meses as $mes=>$dias):
?>
<tr>
<td><?php echo $mes; ?></td>
<td><?php echo $dias; ?></td>
</tr>
<?php
endforeach;
?>
</table>
</body>
</html>
<?php
$meses = array(
"Enero" => "31",
"Febrero" => "28",
"Marzo" => "31",
"Abril" => "30",
"Mayo" => "31",
"Junio" => "30",
"Julio" => "31",
"Agosto" => "31",
"Septiembre" => "30",
"Octubre" => "31",
"Noviembre" => "30",
"Diciembre" => "31"
);
$table = implode(
array_map(
function ($mes, $dias) {
return sprintf('<tr><td>%s</td><td>%s</td></tr>', $mes, $dias);
},
array_keys($meses),
$meses
)
);
?>
<table>
<?php echo $table; ?>
</table>
<?php
$meses = array(
"Enero" => "31",
"Febrero" => "28",
"Marzo" => "31",
"Abril" => "30",
"Mayo" => "31",
"Junio" => "30",
"Julio" => "31",
"Agosto" => "31",
"Septiembre" => "30",
"Octubre" => "31",
"Noviembre" => "30",
"Diciembre" => "31"
);
$table = array_reduce(
array_keys($meses),
function ($c, $mes) use ($meses) {
return $c .= sprintf('<tr><td>%s</td><td>%s</td></tr>', $mes, $meses[$mes]);
},
);
?>
<table>
<?php echo $table; ?>
</table>