What I want is to be able to count the amount of guards and hitpoints both users lose during the battle loops. I thought of earlier, getting the before the loop amounts BEFORE the loops / battle actually starts, and then the AFTER amounts. The problem I'm running into, with my thinking, is that if I create a variable that defines the hitpoints before the battle, then, of course, that variable will change with each loops in the battle, so it would be the same at the end. I think I may be answering myself as I type. Maybe the database is the key, but still wouldn't know how to keep the current hitpoints from changing as the battle went on.
Example:
$beforehitpoints = $currenthitpoints...
But the $currenthitpoints would change when you looped through the battle, so how would I store the original amount of hitpoints that they began with and then at the end, do some simple math to figure out how many hitpoints they lost and echo that to the user? If I just echo the hitpoints BEFORE the loop and then AFTER the loop, it does what I expected it to do; exact same amounts