Location: PHPKode > scripts > PHP Poker Engine > php-poker-engine/testTexasDeckweb3.php
<?php
//include the deck and engine
include("pokerDeck3.php");
include ("phpPokerEngineV3.1.php");
//set player number
$playnum=4;
//create deck
$texasDeck = new deck();
//shuffles and deals new game
$texasDeck->dealTexas($playnum);

/*
THE FOLLOWING DEMOS HOW TO GET DATA AFTER DEALTEXAS IS RUN
*/

print"<p>\n</p>";
//returns Flop
echo "Flop:  ";
print"<p>\n</p>";
//echo $texasDeck->getFlop();
echo $texasDeck->getFlopImg();
print"<p>\n</p>";
//returns Turn
echo "Turn:  ";
print"<p>\n</p>";
//echo $texasDeck->getTurn();
echo $texasDeck->getTurnImg();
print"<p>\n</p>";
//returns River
echo "River:  ";
print"<p>\n</p>";
//echo $texasDeck->getRiver();
echo $texasDeck->getRiverImg();
print"<p>\n</p>";
//print"<p>All pocket hands</p>";
//echo $texasDeck->getallPockets();
print"<p>this is player 1's pocket</p>";
//echo $texasDeck->getPlayer1Pocket();
echo $texasDeck->getpocket1Img();
print"<p>this is player 1's pocket PLUS the FLOP</p>";
//echo $texasDeck->getP1PocketPlusFlop();
echo $texasDeck->getpocket1Img();
echo $texasDeck->getFlopImg();
print"<p>this is player 1's pocket PLUS the FLOP and the TURN</p>";
//echo $texasDeck->getP1PocketFlopTurn();
echo $texasDeck->getpocket1Img();
echo $texasDeck->getFlopImg();
echo $texasDeck->getTurnImg();
print"<p>\n</p>";
echo "This is player 1's pocket PLUS the FLOP, TURN, and RIVER";
print"<p>\n</p>";

echo $texasDeck->getpocket1Img();
echo $texasDeck->getFlopImg();
echo $texasDeck->getTurnImg();
echo $texasDeck->getRiverImg();
print"<p>\n</p>";
/*
THIS FUNCTION WILL EVALUATE THE HANDS HANDS

*/
function handEval($texasDeck, $finalHand)
{
	print"<p>\n</p>";
	//This function coverts the string to the $evaluateArray
	$evaluateArray=$texasDeck->convertIt($finalHand);
	//create an array that is the ASCII count from the variable
	$chart = count_chars($finalHand,1);	
	//create new name for array for poker engine with count results
	$chartArray = array($chart);
	print"<p>\n</p>";
	//instantiate pokerEngine object
	$testIt = new pokerEngine();
	//call handTest method passing both required parameters
	$testIt->handTest($chartArray,$evaluateArray);
	print"<p>\n</p>";
	//get the text description for the hand
	echo $testIt->getText();
	print"<p>\n</p>";
	//get the points
	echo "   Points:   ";
	echo $testIt->getTotalPoints();
}//end handEval
/*
END HAND EVALUATION CODE BLOCK
*/

$finalHand = $texasDeck->getP1FinalHand();
handEval($texasDeck, $finalHand);
print"<p>\n</p>";
echo "player2:";
print"<p>\n</p>";
echo $texasDeck->getpocket2Img();
echo $texasDeck->getFlopImg();
echo $texasDeck->getTurnImg();
echo $texasDeck->getRiverImg();
print"<p>\n</p>";
$finalHand = $texasDeck->getP2FinalHand();
handEval($texasDeck, $finalHand);
print"<p>\n</p>";
print"<p>\n</p>";
echo $texasDeck->getpocket3Img();
echo $texasDeck->getFlopImg();
echo $texasDeck->getTurnImg();
echo $texasDeck->getRiverImg();
print"<p>\n</p>";
$finalHand = $texasDeck->getP3FinalHand();
handEval($texasDeck, $finalHand);
?>
Return current item: PHP Poker Engine