This class works in two ways. You can either feed a single set of 7 cards to receive an analysis of the best 5 card hand, which cards were used an most importantly a numerical score for the quality of the hand which can be used to directly compare multiple hands.
First, let's collect a list of the 7 cards available, including both pocket cards and community cards.
Step 1: Load in the cards
Let's suppose these are our cards....
$cards = array (
"A_HEARTS","3_SPADES", //2 Pocket cards
"8_CLUBS","9_CLUBS","3_HEARTS", "J_SPADES","4_DIAMONDS" //5 Community cards
Now let's see what the computer has to say
$poker = new PokerHandEvaluator();
Step 2: Review the results
$poker->displayableRank() = One Pair
As soon as we
$poker->calculateRank(), everything is calculated. The debug cards feature will show us visually what is calculated, just so we can check our code is running smoothly.
The best 5 cards and all further information is presented in an array
[CARD_IDS] => Array
 => 2
 => 5
 => 1
 => 6
 => 4
[CARD_NAMES] => Array
 => 3_SPADES
 => 3_HEARTS
 => A_HEARTS
 => J_SPADES
 => 9_CLUBS
[NUMERIC_RANK] => 1
[DISPLAYABLE_RANK] => One Pair
[SCORE] => 20314110900
The card IDs are array keys based on the order they were loaded in at the start with
$poker->loadCards().  = First card loaded, and so on.
Card information is stored in the
$poker->cards array based on ID. In this example,
$poker->cards was of course our first card; The Ace of Hearts.
 => Array
[ID] => 1
[PUREID] => 1
[NUMBER] => 1
[SUIT] => HEARTS
[ORDER_RANK] => 4
[INPUT] => A_HEARTS
Yep. One Pair looks right to me. Good job, Algorithm!
You can use
$poker->hand_information['SCORE'] to compare multiple players and see who won. Simples
Step 3: Have a beer
The algorithm is that easy and you just saved dozens of development hours without writing boring algorithms.
Have a beer, you've earnt it.