一个简单的php 获取身份证信息类-亲测可用
class GetInfoByIDCard{
/**根据身份证号,自动返回对应的星座
* @param $cid
* @return string
*/
public function getStarSign($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 <= 21) || ($month == 2 && $day <= 19)) {
$strValue = "水瓶座";
} else if (($month == 2 && $day > 20) || ($month == 3 && $day <= 20)) {
$strValue = "双鱼座";
} else if (($month == 3 && $day > 20) || ($month == 4 && $day <= 20)) {
$strValue = "白羊座";
} else if (($month == 4 && $day > 20) || ($month == 5 && $day <= 21)) {
$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 <= 23)) {
$strValue = "狮子座";
} else if (($month == 8 && $day >