php代码
<?php function pc_checkbirthdate($month, $day, $year) { $min_age = 18; // 过18岁 $max_age = 100; // 超过122岁 // 验证是不是合法时间,不会出现2月30号类似错误 if (! checkdate ( $month, $day, $year )) { return false; } // 取得当前 年 月 日 list ( $this_year, $this_month, $this_day ) = explode ( ',', date ( 'Y, m, d' ) ); $min_year = $this_year - $max_age; $max_year = $this_year - $min_age; print "合法时间应该大于:$min_year,$this_month,$this_day\n<br/>"; print "合法时间应该小于:$max_year,$this_month,$this_day\n<br/>"; print "您输入的时间是:$year,$month,$day\n<br/>"; if (($year > $min_year) && ($year < $max_year)) { // 先判断年,如果在(最小年,最大年)之间,返回true return true; } elseif (($year == $max_year) && (($month < $this_month) || (($month == $this_month && ($day < $this_day))))) {//年相等的在判断月,月相等在判断日 return true; } elseif (($year == $min_year) && (($month > $this_month) || (($month == $this_month && ($day > $this_day))))) { return true; } else { return false; } } if (pc_checkbirthdate ( 4, 29, 1995 )) { print "You may use this web site."; } else { print "please input the correct birthdate."; exit (); } ?>
陳述
本文內容由網友自願投稿,版權歸原作者所有。本站不承擔相應的法律責任。如發現涉嫌抄襲或侵權的內容,請聯絡admin@php.cn

熱AI工具

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

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

Undress AI Tool
免費脫衣圖片

Clothoff.io
AI脫衣器

AI Hentai Generator
免費產生 AI 無盡。

熱門文章
R.E.P.O.能量晶體解釋及其做什麼(黃色晶體)
3 週前By尊渡假赌尊渡假赌尊渡假赌
R.E.P.O.最佳圖形設置
3 週前By尊渡假赌尊渡假赌尊渡假赌
刺客信條陰影:貝殼謎語解決方案
2 週前ByDDD
R.E.P.O.如果您聽不到任何人,如何修復音頻
3 週前By尊渡假赌尊渡假赌尊渡假赌
WWE 2K25:如何解鎖Myrise中的所有內容
4 週前By尊渡假赌尊渡假赌尊渡假赌

熱工具

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

Dreamweaver Mac版
視覺化網頁開發工具

WebStorm Mac版
好用的JavaScript開發工具

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

mPDF
mPDF是一個PHP庫,可以從UTF-8編碼的HTML產生PDF檔案。原作者Ian Back編寫mPDF以從他的網站上「即時」輸出PDF文件,並處理不同的語言。與原始腳本如HTML2FPDF相比,它的速度較慢,並且在使用Unicode字體時產生的檔案較大,但支援CSS樣式等,並進行了大量增強。支援幾乎所有語言,包括RTL(阿拉伯語和希伯來語)和CJK(中日韓)。支援嵌套的區塊級元素(如P、DIV),