function checkPukeType($pukes,$doLevel = 100)
{
if(count($pukes) != 5){
return false;
}

//处理检测级别

if($doLevel <= 0){
return false;
}

$pukes = orderPuke($pukes);
//$pukeT = '';

//判断StraightFlush,级别:1
if(isFlush($pukes) && isStraight($pukes)){
$max_num = $pukes[0]['num'];
if($pukes[4]['num'] == 1 && $pukes[0]['num'] == 13){
$max_num = MAX_NUM;
}
$pukeT = new PukeType(1,$max_num);
return $pukeT; //--
}

//处理检测级别
if($doLevel == 1){
return false;
}

//把牌按对子分类
$pk_nums = array();
foreach($pukes as $pk)
{
$pk_nums[$pk['num']][] = $pk;
}

//判断FourofKind,级别:2
$max_num = 0;
$second = 0;
foreach($pk_nums as $key => $arr)
{
if(count($arr) == 1){
$second = $key;
}
elseif(count($arr) == 4) {
$max_num = $key;
}
}

if($max_num == 1){
$max_num = MAX_NUM;
}
elseif($second == 1){
$second = MAX_NUM;
}

if($max_num && $second){
$pukeT = new PukeType(2,$max_num,$second);
return $pukeT; //--
} //处理检测级别
if($doLevel == 2){
return false;
}

//判断BoatorFullHouse,级别:3
$max_num = 0;
$second = 0;
foreach($pk_nums as $key => $arr)
{
if(count($arr) == 2){
$second = $key;
}
elseif(count($arr) == 3) {
$max_num = $key;
}
}

if($max_num && $second){
if($max_num == 1){
$max_num = MAX_NUM;
}
elseif($second == 1){
$second = MAX_NUM;
}
$pukeT = new PukeType(3,$max_num,$second);
return $pukeT; //--
}

//处理检测级别
if($doLevel == 3){
return false;
}

//判断PFlush,级别:4
$max_num = 0;
if(isFlush($pukes)){
$max_num = $pukes[0]['num'];
if($pukes[4]['num'] == 1){
$max_num = MAX_NUM;
}
$pukeT = new PukeType(4,$max_num);
return $pukeT; //--
} //处理检测级别
if($doLevel == 4){
return false;
}

//判断Staight,级别:5
$max_num = 0;
if(isStraight($pukes)){
$max_num = $pukes[0]['num'];
if($pukes[4]['num'] == 1 && $pukes[0]['num'] == 13){
$max_num = MAX_NUM;
}
$pukeT = new PukeType(5,$max_num);
return $pukeT; //--
} //处理检测级别
if($doLevel == 5){
return false;
}

//判断ThreeofKind,级别:6
$max_num = 0;
$second = 0;
$third = 0;
foreach($pk_nums as $key => $arr)
{
if(count($arr) == 3){
$max_num = $key;
}
elseif(count($arr) == 1 && !$second) {
$second = $key;
}
else {
$third = $key;
}
}

if($max_num && $second && $third){
if($max_num == 1){
$max_num = MAX_NUM;
}
elseif($third == 1){
$third = $second;
$second = MAX_NUM;
}
$pukeT = new PukeType(6,$max_num,$second,$third);
return $pukeT; //--
} //处理检测级别
if($doLevel == 6){
return false;
}

//判断TwoPairs,级别:7
$max_num = 0;
$second = 0;
$third = 0;
foreach($pk_nums as $key => $arr)
{
if(count($arr) == 2 && !$max_num){
$max_num = $key;
}
elseif(count($arr) == 2) {
$second = $key;
}
else {
$third = $key;
}
}

if($max_num && $second && $third){
if($second == 1){
$second = $max_num;
$max_num = MAX_NUM;
}
elseif($third == 1){
$third = MAX_NUM;
}
$pukeT = new PukeType(7,$max_num,$second,$third);
return $pukeT; //--
}

//处理检测级别
if($doLevel == 7){
return false;
}

//判断onePair,级别:8
$max_num = 0;
$second = 0;
$third = 0;
$fourth = 0;
foreach($pk_nums as $key => $arr)
{
if(count($arr) == 2){
$max_num = $key;
}
elseif(!$second) {
$second = $key;
}
elseif(!$third) {
$third = $key;
}
else{
$fourth = $key;
}
}

if($max_num && $second && $third && $fourth){
if($max_num == 1){
$max_num = MAX_NUM;
}
if($fourth == 1){
$fourth = $third;
$third = $second;
$second = MAX_NUM;
} $pukeT = new PukeType(8,$max_num,$second,$third,$fourth);
return $pukeT; //--
}

//处理检测级别
if($doLevel == 8){
return false;
}

//判断HighHand,级别:9
//print_r($pukes);exit;
$max_num = $pukes[0]['num'];
$second = $pukes[1]['num'];
$third = $pukes[2]['num'];
$fourth = $pukes[3]['num'];
$fifth = $pukes[4]['num'];

if($fifth == 1){
$fifth = $fourth;
$fourth = $third;
$third = $second;
$second = $max_num;
$max_num = MAX_NUM; 
}
$pukeT = new PukeType(9,$max_num,$second,$third,$fourth,$fifth);
return $pukeT; //--

}