I was trying to assign each seller their monthly points, based on the amount of products they sell. The numbers, however, are just an example. This is my code so far:
$sellers = array(
'Edvin' => 10,
'Julio' => 9,
'Rene' => 8,
'Jorge' => 7,
'Marvin' => 6,
'Brayan' => 5,
'Sergio' => 4,
'Delfido' => 3,
'Jhon' => 2
);
$a = 1;
foreach ($sellers as $seller => $points) {
while ($a < 4) {
echo "The seller top " . $a . " is " . $sellers[$a - 1] . ' with ' . $points[$a] . '<br>';
$a++;
}
}
I am trying to output this:
The seller top 1 is Edvin with 10<br>
The seller top 2 is Julio with 9<br>
The seller top 3 is Rene with 8<br>