class IdcardAction extends Action{ function get_xingzuo($cid) { if (!$this->isIdCard($cid)) return ''; $bir = substr($cid,10,4); $month = (int)substr($bir,0,2); $day = (int)substr($bir,2); $strValue = ''; if (($month == 1 && $day >= 20) || ($month == 2 && $day <= 18)) { $strValue = "水瓶座"; } else if (($month == 2 && $day >= 19) || ($month == 3 && $day <= 20)) { $strValue = "雙魚座"; } else if (($month == 3 && $day > 20) || ($month == 4 && $day <= 19)) { $strValue = "白羊座"; } else if (($month == 4 && $day >= 20) || ($month == 5 && $day <= 20)) { $strValue = "金牛座"; } else if (($month == 5 && $day >= 21) || ($month == 6 && $day <= 21)) { $strValue = "雙子座"; } else if (($month == 6 && $day > 21) || ($month == 7 && $day <= 22)) { $strValue = "巨蟹座"; } else if (($month == 7 && $day > 22) || ($month == 8 && $day <= 22)) { $strValue = "獅子座"; } else if (($month == 8 && $day >= 23) || ($month == 9 && $day <= 22)) { $strValue = "處女座"; } else if (($month == 9 && $day >= 23) || ($month == 10 && $day <= 23)) { $strValue = "天秤座"; } else if (($month == 10 && $day > 23) || ($month == 11 && $day <= 22)) { $strValue = "天蝎座"; } else if (($month == 11 && $day > 22) || ($month == 12 && $day <= 21)) { $strValue = "射手座"; } else if (($month == 12 && $day > 21) || ($month == 1 && $day <= 19)) { $strValue = "魔羯座"; } return $strValue; }
?PHP根據(jù)身份證號,自動獲取對應的星座函數(shù),然后自動返回對應的星座,自動返回性別,判斷是否成年
本站所有資源均由網(wǎng)友貢獻或各大下載網(wǎng)站轉(zhuǎn)載。請自行檢查軟件的完整性!本站所有資源僅供學習參考。請不要將它們用于商業(yè)目的。否則,一切后果由您負責!如有侵權(quán),請聯(lián)系我們刪除。聯(lián)系方式:admin@php.cn
相關(guān)文章

29 Nov 2024
身份驗證是驗證用戶身份的過程。這是一項基本的安全措施,可確保只有經(jīng)過授權(quán)的個人才能訪問系統(tǒng)和數(shù)據(jù)。隨著技術(shù)的進步,身份驗證方法也在不斷進步。讓我們探索一些

03 Nov 2024
從 Next.js 15 開始,處理身份驗證變得更加強大和靈活,特別是憑借其高級服務器組件、Actions API 和中間件功能。在本文中,我們將探討實施身份驗證的最佳實踐

01 Nov 2024
概述 基本身份驗證中間件提供了一種強大而靈活的方法來保護您的 Iris Web 應用程序。它支持各種用戶存儲方式,包括內(nèi)存列表、文件和數(shù)據(jù)庫,并提供高級功能,例如

08 Jul 2023
PHP如何使用MongoDB進行用戶身份驗證摘要:本文將介紹如何使用PHP和MongoDB進行用戶身份驗證。我們將通過示例代碼演示如何在MongoDB數(shù)據(jù)庫中創(chuàng)建用戶集合、插入用戶數(shù)據(jù)、驗證用戶登錄以及檢查用戶權(quán)限。介紹隨著互聯(lián)網(wǎng)的快速發(fā)展,用戶身份驗證成為了一個必不可少的功能。MongoDB是一個非常流行的NoSQL數(shù)據(jù)庫,它提供了靈活的數(shù)據(jù)模型和高性能的

19 Dec 2024
NestJS 中 zod 與類驗證器和類轉(zhuǎn)換器的比較 我對 zod 或類驗證器和類轉(zhuǎn)換器之間感到困惑,或者至少很好奇 作為 NestJS 中的驗證庫。 要點 直接去吧

18 Feb 2025
UserApp.io是一種方便的用戶管理工具和API。它提供了一個Web界面來處理用戶帳戶(以及這涉及的許多功能)和一個API,將它們吸引到您自己的Web應用程序中。這項服務的目的是使其更容易


熱工具

依賴注入容器的PHP庫
依賴注入容器的PHP庫

50個優(yōu)秀經(jīng)典PHP算法大集合
經(jīng)典PHP算法,學習優(yōu)秀的思想 , 開拓思維

小巧的優(yōu)化圖片的PHP庫
小巧的優(yōu)化圖片的PHP庫
