How to sort a multi-column data? That is, suppose an array contains following columns

LastName
FirstName
Country
City

I want to sort them by LastName, FirstName, Country, City.

What is the way to that? One obvious solution appears to concatenate each field value as a single string and sort then, but is there any better solution? Also, if any field is number, the above said method won't work easily? Any suggestion?

Please don't post database commands (like order by). I like to know how to do it programmatically.

thanks