please, how to sort by percent? Inside foreach ?
this is how I have built the code
foreach($rows as $data) {
$percent = 80; //this is the result I will get
echo "<div>Product has $percent %</div>";
}
I have a percentage calculation inside
please, how to sort by percent? Inside foreach ?
this is how I have built the code
foreach($rows as $data) {
$percent = 80; //this is the result I will get
echo "<div>Product has $percent %</div>";
}
I have a percentage calculation inside
I do not know anything about php but to keep it simple I would do the calculations, sort the data in the table and then display the table. However, if you want to do this on the fly you would need to have an array/list where the new elements are inserted in the correct order after each calculation. Perhaps php has such a collection available. I don’t know.