php日曆程式碼 三個不錯的php日曆程式碼
|
2,php日曆代碼2
- /**
- * 日曆
- */
- if (function_exists('date_default_timezone_set')) {date_setz '亞洲/重慶');
- }
- $date = isset($_GET['date']) ? $_GET['date'] : 日期('年月日');
- $date = getdate(strtotime($date));
- $end = getdate(mktime(0, 0, 0, $date['mon'] + 1, 1, $date['year']) - 1);
- $start = getdate(mktime(0, 0, 0, $date['mon'], 1, $date['year']));
- $pre = date('年-月-日', $start[0] - 1);
- $next = date('年月日', $end[0] + 86400);
- $html = '
align="center" style="line-height:150%; 字體-family:Verdana, 字體大小: 12px;">';
';- $html .= '
'; ';- $html .= '
- td>'; - $html .= '
' 。 $日期['年'] . ';' 。 $日期['月份'] 。 ' ';- $html .= '
+ ' ;- $html .= '
- $arr_tpl = array(0 => '', 1 => '', 2 => '', 3 => '', 4 => '', 5 => '', 6 => '');
- $date_arr = array();
- $j = 0;
- for ($i = 0; $i if (!isset($date_arr[$j])) {
- $date_arr[$ j] = $arr_tpl;
- }
- $date_arr[$ j][($i+$start['wday'])%7] = $i+1;
- if ($date_arr[$j][6]) {
- $j++;
- }
- }
- foreach ($date_arr as $value) {
- $html .= '
'; ';- foreach ($value as $v) {
- if ($v) {
- if ($v == $date['mday']) {
- $html .= '
;' 。 $v。 ' ';- } else {
- $html .= '
' 。 $v。 ' ';- }
- } else {
- $html .= '
; ';- }
- }
- $html .= '
- }
- $html .= '
- $html .= '
- 回顯$html;
- ?>
3,php日曆碼三:
/**
- * php日曆程式碼
- * edit: bbs.it-home.org
- */
- 函數日曆()
- {
- if ($_GET['ym'])
- {
- $year = substr($_GET['ym'],0,4);
- $month = substr($_GET['ym'],4,(strlen($_GET['ym'])-4));
if($month>12 )
- {
- $年+= 下限($月/12);
- $月 = $月 % 12;
- }
- if($year > 2030) $year = 2030;
- if($year }
$year = isset($year) ? $year : 日期('Y');
- $month = isset($month) ? $month : date('n');
if($year==date('Y') && $month==date('n')) $today = date(' j');
if($month-1 == 0)
- $prevmonth = ($year - 1)."12";
- else $prevmonth = $year.($month - 1);
if($month+1 == 13)
- $nextmonth = ($year+1). 「1」;
- 否則 $nextmonth = $year.($month+1);
$prevyear = ($year - 1).$month;
- $nextyear = ($year + 1).$month;
-
echo
; $年- $月 > >> ; 日 一 二 三 四 五 六 - VKN;
- $nowtime = mktime(0,0,0,$month,1,$year);//當月一號轉為秒
- $daysofmonth = date(t, $nowtime);//當月天數
- $weekofbeginday = date(w,$nowtime);//當月第一天是星期幾
- $weekofendday = date(w,mktime(0,0,0,$ Month+1,0,$year) );//當月最後一天是星期幾
- $daysofprevmonth = date(t,mktime(0,0,0,$month,0,$year));//上月天數
$count = 1;//統計
- // 上月後幾天上市
- for($i = 1 ; $i {
- echo "
".($daysofprevmonth-$weekofbeginday+$i)." ";- $count++;
- }
- //當月全部
- for($i = 1 ; $i {
- $css = ($count%7==0 | | $count%7==1)?"工作日":"正常的一天";
- if($i == $today) $css .= "today";
echo "
".$i. “ ”;- if($count%7==0) echo "
"; - $count++;
- }
- //下月前幾天
- for ($i = 1;$i {
- echo "
".$i." ";- }
echo
; - 表>
- VKN;
- }
- ? >
- >

熱AI工具

Undresser.AI Undress
人工智慧驅動的應用程序,用於創建逼真的裸體照片

AI Clothes Remover
用於從照片中去除衣服的線上人工智慧工具。

Undress AI Tool
免費脫衣圖片

Clothoff.io
AI脫衣器

AI Hentai Generator
免費產生 AI 無盡。

熱門文章

熱工具

記事本++7.3.1
好用且免費的程式碼編輯器

SublimeText3漢化版
中文版,非常好用

禪工作室 13.0.1
強大的PHP整合開發環境

Dreamweaver CS6
視覺化網頁開發工具

SublimeText3 Mac版
神級程式碼編輯軟體(SublimeText3)

熱門話題

PHP客戶端URL(curl)擴展是開發人員的強大工具,可以與遠程服務器和REST API無縫交互。通過利用Libcurl(備受尊敬的多協議文件傳輸庫),PHP curl促進了有效的執行

JWT是一種基於JSON的開放標準,用於在各方之間安全地傳輸信息,主要用於身份驗證和信息交換。 1.JWT由Header、Payload和Signature三部分組成。 2.JWT的工作原理包括生成JWT、驗證JWT和解析Payload三個步驟。 3.在PHP中使用JWT進行身份驗證時,可以生成和驗證JWT,並在高級用法中包含用戶角色和權限信息。 4.常見錯誤包括簽名驗證失敗、令牌過期和Payload過大,調試技巧包括使用調試工具和日誌記錄。 5.性能優化和最佳實踐包括使用合適的簽名算法、合理設置有效期、

文章討論了PHP 5.3中介紹的PHP中的晚期靜態結合(LSB),允許靜態方法的運行時間分辨率調用以更靈活的繼承。 LSB的實用應用和潛在的觸摸

使用PHP的cURL庫發送JSON數據在PHP開發中,經常需要與外部API進行交互,其中一種常見的方式是使用cURL庫發送POST�...

深入解讀ReactPHP的非阻塞特性ReactPHP的一段官方介紹引起了不少開發者的疑問:“ReactPHPisnon-blockingbydefault....
