We can use array_reverse function to invert the values of array.This way we can allow them to get reverse order.
Ex : -
$data = Array(
'ProductA',
'ProductB',
'ProductC',
'ProductD',
'ProductE'
);
foreach ( array_reverse($data) as $value ) {
echo sprintf("<li>%s</li>", $value);
}
Output is like -
ProductE
ProductD
ProductC
ProductB
ProductA
0 Comment(s)