1

I'm trying to create Contest list of users in php.

But my code style don't give me what I want

My code:

<?php

$users = ["129292199", "616161616", "272727272", "555554433", "666665886"];
$count = 0;

foreach ($users as $name){
    $count += 1;
    echo  "{$count} $name\n";
}

?>

My code output

1 129292199
2 616161616
3 272727272
4 555554433
5 666665886

But I want something like this

 1st : 5453674081
 2nd : 135678975
 3rd : 5607170108
4️⃣ 4th : 1460057759
5️⃣ 5th : 1664868970
  • See https://stackoverflow.com/questions/3109978/display-numbers-with-ordinal-suffix-in-php for how to display numbers like `1st`. And add an `` before the number with a URL that points to the appropriate image for each place. – Barmar Jan 06 '23 at 23:55
  • @Barmar how can I use normal keyboard emoji to do it instead of image – Meta Airdroper Jan 06 '23 at 23:59
  • You can just echo the emoji – Barmar Jan 07 '23 at 00:59

1 Answers1

0

you can wrap the count variable inside a class and style it with css