I have a code that has an input of type month that generates a calendar with the values passed in the input, however it saves the values in this standard 2000-12, and I want to display the name of the month on the calendar but not is it possible because the month is passed in digits, is there any way to get the values directly from the input?
<body>
<?php
$datee = explode('-', $_POST['datac']);
$mes = $datee[1];
$ano = $datee[0];
$ultimo_dia = date("t", mktime(0,0,0,$mes,'01',$ano));
if ($mes == date('m')){
$dias = $ultimo_dia;
}elseif ( $mes == '') {
$mes = date('m');
$ano = date('o');
$dias = $ultimo_dia;
}else{
$dias = $ultimo_dia;
}
?>
<?php
echo '<h4>'.$mes. ' de ' .$ano.'</h4>';
?>
<form method="post" action="date.php">
<input type="month" name="datac" value="<?php echo $ano?>-<?php echo $mes?>" required><input type="submit">
<table class="table table-striped" width="210" border="2" cellspacing="4" cellpadding="4">
<tr>
<td width="80px"><center>Domingo</center></td>
<td width="80px"><center>Segunda</center></td>
<td width="80px"><center>Terça</center></td>
<td width="80px"><center>Quarta</center></td>
<td width="80px"><center>Quinta</center></td>
<td width="80px"><center>Sexta</center></td>
<td width="80px"><center>Sábado</center></td>
</tr>
<?php
echo "<tr>";
for ($i = 1; $i <= $dias; $i++) {
$diadasemana = date("w", mktime(0, 0, 0, $mes, $i, $ano));
$cont = 0;
if ($i == 1) {
while ($cont < $diadasemana) {
echo "<td></td>";
$cont++;
}
}
echo "<td width='100px' height='100px'><center>";
echo $i;
echo "</center></td>";
if ($diadasemana == 6) {
echo "</tr>";
echo "<tr>";
}
}
echo "</tr>";
?>
</table>
</form>
</body>
</html>