How to perform a natural sort in php using usort
Use strnatcmp for your comparison function. e.g. it's as simple as
function mysort($a, $b) {
return strnatcmp($a->rate, $b->rate);
}
Use strnatcmp for your comparison function. e.g. it's as simple as
function mysort($a, $b) {
return strnatcmp($a->rate, $b->rate);
}