I ran an election that has a variable number of winners for each category. (One category can have 3 winners, another 1 winner, another 2 winners, etc.)
Currently I am displaying the results like this:
foreach($newarray as $key => $value){
echo $key . $value . “<br>”;
}
This returns
Barack Obama 100
Mitt Romney 100
John Smith 94
Jane Smith 85
What I need to do is have it echo out something if two of the values are the same based on that predetermined number. So, if the predetermined number was one, it would show this:
Barack Obama 100 tie
Mitt Romney 100 tie
John Smith 94
Jane Smith 85
If the predetermined number was two, it would show this since the second and third values aren’t the same:
Barack Obama 100 winner
Mitt Romney 100 winner
John Smith 94
Jane Smith 85
Thank you for your time.