07/12/08 01:17:01
>>439
凄いですね。いろんなことができるんだ、と感心しきり。
少しだけ縮めた。
<?php list($v,$w,$d)=explode("-",$a=q("$_GET[y]-1","Y-m-t"));$f=q("$v-$w-1","w"
);echo$l="<a href=?y=",q($w-1,"Y-m",1),"><</a>$v-$w$l",q($w+1,"Y-m",1),">></a>
$l>now</a><table><tr>";for($i=-6-$f;$i<$d-q($a,"w")+7;){echo$i<1-$f?"<th>".q($w
,"D",$i)."</th>":"<td>".($i<1||$i>$d?"":$i)."</td>";if(($f+$i++)%7==0)echo"</tr
><tr>";}function q($w,$x,$i=0){global$v;return date($x,$i?mktime(0,0,0,$w,$i,$v
):strtotime($w));}?></tr></table>