I am getting some IDs from database and showing on page like this
2,
5,
9,
1,
7,
Anyone have idea how can i set and show like this in php
9,
7,
5,
2,
1,
I am getting some IDs from database and showing on page like this
2,
5,
9,
1,
7,
Anyone have idea how can i set and show like this in php
9,
7,
5,
2,
1,
Use rsort()
. Try with -
while($row = $result->fetch_assoc()) {
$ids[] = $row['id'];
}
$ids = rsort($ids);