PHP实现扎金花游戏之大小比赛的方法(3)

echo 'card1 is ',printCard($card1),'<br/>'; 
echo 'card2 is ',printCard($card2),'<br/>'; 
$str = 'card1 equit card2'; 
if($result == 1) $str =  'card1 is larger than card2'; 
elseif($result == -1) $str = 'card1 is smaller than card2'; 
echo $str; 

function printCard($card) 

    $str = '('; 
    foreach($card as $v){ 
        $str .= $v[0].$v[1].','; 
    } 
    return trim($str,',').')'; 
}

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:http://www.heiqu.com/84330c38bcd733aff3f7fdd41d2bd606.html