Joining a Coin Toss

So I a coin toss php but all it only shows if it was tails or heads that won. That is ok for me but that happens only once. I want it to so that people would put in their desired amount of “virtual” money in so they would make a lobby to which another person could join with the same amount of money.

This is the current code:

$flipCount = 0;
do {
    $flip = rand(0,1);
    $flipCount ++;
    if ($flip){
        echo "<div class=\"coin\">H</div>";
    else {
        echo "<div class=\"coin\">T</div>";
} while ($flip);
$verb = "were";
$last = "flips";
if ($flipCount == 1) {
    $verb = "was";
    $last = "flip";
echo "<p>There {$verb} {$flipCount} {$last}!</p>";