array('金','申','酉'),'木' => array('木','亥','子'),'水' => array('水','寅','卯'),'火' => array('火','巳','午'),'土' => array('土','丑','戌','辰','未'));$wuxing_score = 0;foreach ($wuxing as $element => $characters) {if (preg_match('/'.$element.'|'.$characters[0].'|'.$characters[1].'|'.$characters[2].'/', $name)) {$wuxing_score += 5;}}$score += $wuxing_score;// 检查生肖运势$shenxiao = array('鼠' => array('子','寅','卯'),'牛' => array('丑','辰','未'),'虎' => array('寅','巳','申'),'兔' => array('卯','午','酉'),'龙' => array('辰','申','戌'),'蛇' => array('巳','酉','丑'),'马' => array('午','戌','寅'),'羊' => array('未','子','卯'),'猴' => array('申','子','辰'),'鸡' => array('酉','丑','巳'),'狗' => array('戌','寅','午'),'猪' => array('亥','卯','未'));$shenxiao_score = 0;foreach ($shenxiao as $animal => $characters) {if (preg_match('/'.$animal.'|'.$characters[0].'|'.$characters[1].'|'.$characters[2].'/', $name)) {$shenxiao_score += 5;}}$score += $shenxiao_score;// 输出分数echo "
您的宝宝名字得分为:$score
";if ($score >= 80) {echo "
您的宝宝名字得分很高,寓意吉祥,读音悦耳,是一个非常不错的名字。
";} elseif ($score >= 60) {echo "
您的宝宝名字得分中等,有一定的吉祥寓意和读音和谐,可以考虑使用。
";} else {echo "
您的宝宝名字得分较低,建议您重新考虑起名,以符合龙年元素、五行原理和生肖运势。
";}}?>