Hi all,
I need to find a key relative to a name in a multidimensional array. Here is my array.
$playerarray = Array ( [0] => Array ( [Player1] => jimmydee2 [Reg] => 1 [Rank] => 3 [Rating] => 1490 [Checkedin] => Checked In [Wins] => 0 [Losses] => 0 ) [1] => Array ( [Player1] => bob2 [Reg] => 2 [Rank] => 1 [Rating] => 1738 [Checkedin] => Checked In [Wins] => 0 [Losses] => 0 ) )
and here is my code.
foreach ($playerarray as $key => $value) {
if ($value == "$winnername") {
echo "Winnerkey".$key;
}
}
I need to know so that I can reference sonething further down in the code. Example $playerarray[$winnerkey][Wins] and use this to adjust there wins.
Is my coding wrong to return the key that the winner is in?