Jump to content

Need to print out dates in a month? Example Shown..


Solarpitch

Recommended Posts

Hey Guys,

 

I have an application where I need to print out each date in a month and have it displayed like the below image. Just wondering what would be the best way to do this?

 

This is as far as I got

 

<?php


function display_calendar($year)
{

dbconnect();

$my_info[0] = "<table>
    <tr>
    <td>M</td>
    <td>T</td>
    <td>W</td>
    <td>T</td>
    <td>F</td>
    <td>Sa</td>
    <td>Su</td>

    <td>M</td>
    <td>T</td>
    <td>W</td>
    <td>T</td>
    <td>F</td>
    <td>Sa</td>
    <td>Su</td>

    <td>M</td>
    <td>T</td>
    <td>W</td>
    <td>T</td>
    <td>F</td>
    <td>Sa</td>
    <td>Su</td>

    <td>M</td>
    <td>T</td>
    <td>W</td>
    <td>T</td>
    <td>F</td>
    <td>Sa</td>
    <td>Su</td>

    <td>M</td>
    <td>T</td>
    </tr><br />";



	for ($i=1; $i<12; $i++ ) {


				$my_info[0] .= "	
	 			<tr>

				"; 
				//THIS IS THE PART I'M CONFUSED ABOUT. WOULD NEED TO LOOP THROUGH EACH MONTH AND RETURN THE DATES BASED ON THE YEAR
				$my_info[0] .= "<td></td>";


			}



				$my_info[0] .= "</tr></table><br />";


				return $my_info;

}


?>

 

ex5919.gif

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.