Working on a simple poker script in PHP and need a way to determine if the player has TWO PAIRS of cards.
I have the players cards stored in an array ($hand) like:
Array (
[0] => Array (
[face] => k
[suit] => d
)
[1] => Array (
[face] => 6
[suit] => s
)
[2] => Array (
[face] => 6
[suit] => h
)
[3] => Array (
[face] => 4
[suit] => d
)
[4] => Array (
[face] => 7
[suit] => h
)
)
So if he had 2 aces, it wouldnt register, but if he had 2 aces and 2 kings, or 2 3’s and 2 4’s then it would.
1 Answer