›œ› Žw’èT‚Ì—j“ú‚©‚ç“ú•t‚ðŽæ“¾ ›œ›
¡‚Ü‚¸ $d_array = getdate() ‚ÅŒ»ÝŽžƒf[ƒ^‚ðŽæ“¾


-------‚Ü‚¸‚Í“ú•t‚ðŽæ“¾‚·‚é—á‚©‚ç‚Å‚·-------

¡ˆÈ‰ºforeach($d_array as $key => $value)•¶‚Å”z—ñ‚ð“WŠJ@c echo $d_array['$key']$value ‚ŏ‘‚«o‚µ

Ÿ$d_array[seconds]50
Ÿ$d_array[minutes]25
Ÿ$d_array[hours]10
Ÿ$d_array[mday]16
Ÿ$d_array[wday]6
Ÿ$d_array[mon]12
Ÿ$d_array[year]2017
Ÿ$d_array[yday]349
Ÿ$d_array[weekday]Saturday
Ÿ$d_array[month]December
Ÿ$d_array[0]1513387550

¡ˆÈ‰ºecho $d_array['seconds'] ‚È‚Ç‚Ì•û–@‚Å‚à“¯‚¶Ž–

Ÿ$d_array['seconds']50
Ÿ$d_array['minutes']25
Ÿ$d_array['hours']10
Ÿ$d_array['mday']16
Ÿ$d_array['wday']6@–c“ú—j“ú‚ª 0A“y—j“ú‚ª 6
Ÿ$d_array['mon']12
Ÿ$d_array['year']2017
Ÿ$d_array['yday']349@–c‚PŒŽ‚P“ú‚©‚ç‚ÌŒo‰ß“ú
Ÿ$d_array['weekday']Saturday
Ÿ$d_array['month']December
Ÿ$d_array[0]1513387550@–cƒ^ƒCƒ€ƒXƒ^ƒ“ƒv

Ÿ‰[”N‚©•½”N‚©H $lp 0()@–c0 •½”NA1 ‰[”N

Ÿ¡“ú‚Ì—j“ú SAT

-------‚Å‚ÍŽw’èT‚Ì—j“ú‚©‚ç“ú•t‚ðŽæ“¾‚µ‚Ä‚Ý‚Ü‚µ‚傤-------

¡¡ŒŽi12ŒŽj‚Ì‘æ‚Q“y—j“ú‚Í 9“ú‚Å‚·

¡¡”N‚P‚OŒŽ‚Ì‘æ‚R“ú—j“ú‚Í 15“ú‚Å‚·
¡¼—ï”NŒŽ‚Ì‘æT‚Ì—j“ú‚́Hc


-------ˆÈ‰º‚ÍŠeƒXƒNƒŠƒvƒg‚Ì“à—e‚Å‚·-------
// ‰[”N‚©•½”N‚©H
// require("php_lib.inc");

$leap = new LeapYear; // LIBƒtƒ@ƒCƒ‹‚æ‚è
$lp = $leap -> leap_year($d_array['year']);
if($lp == 1){$leb = 29;}else{$leb = 28;} // ‰[”N‚Ì‚QŒŽ‚Ì“ú”’²®
echo 'Ÿ‰[”N‚©•½”N‚©H $lp '.$lp.'('.$leb.')'.'@–c0 •½”NA1 ‰[”N';
$get = new GetWeek($d_array['year'],$d_array['mon'],$d_array['mday']); // Œ»Ý”NŒŽ LIBƒtƒ@ƒCƒ‹‚æ‚è

echo 'Ÿ¡“ú‚Ì—j“ú ';
echo $get -> week_get(); //¡“ú‚Ì—j“ú
// ”CˆÓ‚Ì”NŒŽ“ú‚Å’²‚ׂé if(!$y_y){
@@$bgny = $d_array['year']-5;
@@$endy = $d_array['year']+5;
@@echo 'qform method=POST action=week_day.php#aaar';
@@echo '¡¼—ïqselect size=1 name=y_yr';
@@for($yi=$bgny; $yi<=$endy; $yi++){
@@@@if($yi == $d_array['year']){
@@@@@@echo 'qoption value='.$yi.' selectedr'.$yi.'q/optionr';
@@@@}else{ @@@@@@echo 'qoption value='.$yi.'r'.$yi.'q/optionr';
@@@@}
@@}
@@echo 'q/selectr”N';
@@echo 'qselect size=1 name=m_mr';
@@for($mi=1; $mi<=12; $mi++){
@@@@if($mi == $d_array['mon']){
@@@@@@echo 'qoption value='.$mi.' selectedr'.$mi.'q/optionr';
@@@@}else{
@@@@@@echo 'qoption value='.$mi.'r'.$mi.'q/optionr';
@@@@}
@@}
@@echo 'q/selectrŒŽ‚Ì';
@@echo '‘æqselect size=1 name=w_wr';
@@for($wi=1; $wi<=5; $wi++){
@@@@echo 'qoption value='.$wi.'r'.$wi.'q/optionr';
@@}
@@echo 'q/selectrT‚Ì';
@@echo 'qselect size=1 name=b_br';
@@for($bi=0; $bi<=6; $bi++){
@@@@echo 'qoption value='.$bi.'r'.$wk_lg[$bi].'q/optionr';
@@}
@@echo 'q/selectr—j“ú‚́Hcqinput type=submit value=GOrq/formr';
}
if($y_y){
@@echo 'qbrr¡¼—ï'.$y_y.'”N'.$m_m.'ŒŽ‚Ì‘æ'.$w_w.'T‚Ì'.$wk_lg[$b_b].'—j“ú‚Í';
@@$mv3 = $mon_val[$m_m]; // Žw’茎‚Ì“ú”
@@$wk_dy3 = week_day($y_y,$m_m,$w_w,$b_b,$mv3);
@@if($wk_dy3 == 'non'){
@@@@echo $t_fontr.'‘¶Ý‚µ‚Ü‚¹‚ñI'.$t_fontb.'qbrr';
@@}else{
@@@@echo $t_fontr.$wk_dy3.$t_fontb.'“ú‚Å‚·qbrr';
@@}
@@echo '¡qa href=http://fujikoweb.net/php/week_day.phprÅ‰‚̈ʒu‚É–ß‚éq/ar';
}

-------ˆÈ‰º‚Í‘æHT‚Ì“ú—j“ú‚Ì“ú•t‚ð‹‚ß‚é—á-------
// ¡”N‚Ì‚P‚OŒŽ‘æ‚RT‚Ì“ú—j“ú‚Ì“ú•t‚ð‹‚ß‚é
// ŠÖ” week_day($d_array['year'],10,3,0) ‚ðŒÄo‚·
// week_day(¼—ï”N(4¹À),ŒŽ,‘æ?T,—j“ú(0~6),‰[”N(0or1))

echo '¡¡ŒŽi'.$t_fontr.$d_array['mon'].$t_fontb.'ŒŽj‚Ì‘æ‚Q“y—j“ú‚Í ';
$wk_dy1 = week_day($d_array['year'],$d_array['mon'],2,6,$lp);@// ŠÖ”ŒÄo‚µ
echo $t_fontr.$wk_dy1.$t_fontb.'“ú‚Å‚·';

echo '¡¡”N‚P‚OŒŽ‚Ì‘æŽO“ú—j“ú‚Í ';
$wk_dy2 = week_day($d_array['year'],10,3,0,$lp);@// ŠÖ”ŒÄo‚µ
echo $wk_dy2.'“ú';

// Žw’è‚·‚éT‚Ì—j“ú‚Ì“ú‚ð•Ô‚·ŠÖ”

function week_day(&$year,$month,$wd,$week,$lep){
@@if($lep == 1){$feb = 29;}else{$feb = 28;} // ‰[”N‚Ì‚QŒŽ‚Ì“ú”’²®
@@$mon_val = array(1=>31,2=>$feb,3=>31,4=>30,5=>31,6=>30,7=>31,8=>31,9=>30,10=>31,11=>30,12=>31); // ŒŽ“ú”
@@$mv = $mon_val[$month]; // Žw’茎‚Ì“ú”
@@$bgn = 1+7*($wd-1); // ƒ‹[ƒv‚ÌŠJŽn’l
@@$ed = 7+7*($wd-1); // ƒ‹[ƒv‚̏I—¹’l
@@// ƒ‹[ƒv‚̏I—¹’l‚ªŒŽ“ú”‚æ‚è‘å‚«‚¢ê‡‚ÍŒŽ“ú”‚Æ‚·‚é
@@if($ed > $mv){$end = $mv;}else{$end = $ed;}
@@for($w=$bgn; $w<=$end; $w++){
@@@@$week_pos = date("w",mktime(0,0,0,$month,$w,$year)); // “ú•t‚©‚ç—j“ú‚ðŽæ“¾
@@@@$days[$week_pos] = $w; // Žw’èT‚ÌŠe—j“ú‚ðƒL[‚ɁA“ú‚ð’l‚ɃnƒbƒVƒ…‚ÉŠi”[‚·‚é
@@}
@@if(in_array($days[$week], $days)){ // ”z—ñ‚ÌŽw’è’l‚ª‚ ‚é‚©‚Ç‚¤‚©
@@@@return $days[$week]; // Žw’è‚·‚éT‚Ì—j“ú‚Ì“ú‚ð•Ô‚·
@@}else{
@@@@return 'non'; // –³‚¯‚ê‚΁unonv‚ð•Ô‚·
@@}
}