I'm trying to display only the names that are not empty from this array on a new line for each. Currently, using this, it is only displaying "$playerName1"'s name 10 times. I'm trying to figure out why it's not actually looping through all 10 playerName's. It seems to only be checking $playerName1.
$z = array($playerName1, $playerName2, $playerName3, $playerName4, $playerName5, $playerName6, $playerName7, $playerName8, $playerName9, $playerName10);
$zCounter = 1;
foreach ($z as $allNames) {
while ($allNames != "" && $zCounter < 11) {
echo $allNames . "<br>";
$zCounter++;
}
}
whileloop.!empty($allNames).