http://qs321.pair.com?node_id=86777


in reply to Sort Array

By default sort uses the cmp operator to compare elements, which does a string comparison. In ASCII order, "10" comes before "8", which is why you are getting those results. As wog pointed out, you have to instruct the <=> operator to make it compare things as numbers.

--ZZamboni