- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 25
- 26
- 27
- 28
$dayofmonth = date('t');
$day_count = 1;
$num = 0;
for($i = 0; $i < 7; $i++)
{
$dayofweek = date('w', mktime(0, 0, 0, date('m'), $day_count, date('Y')));
$dayofweek = $dayofweek - 1;
if($dayofweek == -1) $dayofweek = 6;
if($dayofweek == $i)
{
$week[$num][$i] = $day_count;
$day_count++;
}
else $week[$num][$i] = "";
}
while(true)
{
$num++;
for($i = 0; $i < 7; $i++)
{
$week[$num][$i] = $day_count;
$day_count++;
if($day_count > $dayofmonth) break;
}
if($day_count > $dayofmonth) break;
}
guest 28.12.2008 12:58 # 0
теже яйца только проще)