If you have a problem sorting an array with numbers and decimals and you had a comma to separate the thousands. Use the following function.
$newarray = array();
foreach ($array as $price)
{
$newarray[] = number_format($price, 2, ',', '');
}
sort($newarray, SORT_NUMERIC);
No comments:
Post a Comment