esempio completo
codice:
$array_eventi = Array( 'giorno_2' => 'evento x', 'giorno_20' => 'etrento y :fagiano:', 'giorno_21' => 'ebrezza z :fagiano:' );
$thisMonth = getMonth( date('m')+1, date('Y') );
$output = '<table>';
$output .= '<tr><td>D</td><td>L</td><td>M</td><td>M</td><td>G</td><td>V</td><td>S</td></tr>';
$cell = 0;
for( $a = 0, $b = 6; $a < $b; $a++ ) {
$output .= '<tr>';
for( $c = 0, $d = 7; $c < $d; $c++ ) {
if( isSet( $array_eventi[ 'giorno_'.$thisMonth[$cell] ] ) == true ) {
$output .= '<td style="background-color: #F5F5F5;">'.$thisMonth[$cell].'</td>';
}
else {
$output .= '<td>'.$thisMonth[$cell].'</td>';
}
$cell++;
}
$output .= '</tr>';
}
$output .= '</table>';
echo $output;