So we got this function in PHP
strcmp(string $1,string $2) // returns -1,0, or 1;
We Do not however, have an intcmp(); So i created one:>
Sort your data with:
function sortScripts($a, $b) { return $a['order'] - $b['order']; }
Use $b-$a if you want the reversed order.
If the numbers in question exceed PHP's integer range, return ($a < $b) ? -1 : (($a > $b) ? 1 : 0) is more robust.
return ($a < $b) ? -1 : (($a > $b) ? 1 : 0)