身份证验证PHP类
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根据身份证号,自动获取对应的星座函数,然后自动返回对应的星座,自动返回性别,判断是否成年
免责声明
本站所有资源均由网友贡献或各大下载网站转载。请自行检查软件的完整性!本站所有资源仅供学习参考。请不要将它们用于商业目的。否则,一切后果由您负责!如有侵权,请联系我们删除。联系方式:admin@php.cn
相关文章

03 Nov 2024
从 Next.js 15 开始,处理身份验证变得更加强大和灵活,特别是凭借其高级服务器组件、Actions API 和中间件功能。在本文中,我们将探讨实施身份验证的最佳实践

01 Nov 2024
概述 基本身份验证中间件提供了一种强大而灵活的方法来保护您的 Iris Web 应用程序。它支持各种用户存储方式,包括内存列表、文件和数据库,并提供高级功能,例如

08 Jul 2023
PHP如何使用MongoDB进行用户身份验证摘要:本文将介绍如何使用PHP和MongoDB进行用户身份验证。我们将通过示例代码演示如何在MongoDB数据库中创建用户集合、插入用户数据、验证用户登录以及检查用户权限。介绍随着互联网的快速发展,用户身份验证成为了一个必不可少的功能。MongoDB是一个非常流行的NoSQL数据库,它提供了灵活的数据模型和高性能的

18 Feb 2025
UserApp.io是一种方便的用户管理工具和API。它提供了一个Web界面来处理用户帐户(以及这涉及的许多功能)和一个API,将它们吸引到您自己的Web应用程序中。这项服务的目的是使其更容易


Hot Tools

热门文章
王朝战士起源控制器不工作:简单修复
23 Jan 2025
故障排查
如何修复KB5050094无法在Windows 11中安装?
30 Jan 2025
故障排查
如何解决真三国无双:起源在 Windows 中一直冻结的问题?
24 Jan 2025
故障排查
KB5050188 安装失败:无与伦比的方法就在这里
23 Jan 2025
故障排查
Windows 11 KB5049624 中有哪些新增功能以及如何安装?
23 Jan 2025
故障排查