php从身份证获取性别方法

发表于

$sex = substr($card, (strlen($card)==18 ? -2 : -1), 1) % 2 ? '1' : '0';
echo $sex//1为男 0为女

评论

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注