PHP - 如何通过单独的键对数组内的数组进行排序[重复]

Possible Duplicate:
PHP sort multidimensional array by value

I've looked though questions with similar titles and couldn't find the answer to my question. I also can't quite figure out how to implement asort or usort functions into my problem.

So I have an array:

array
{
   array
   {
      'name' => 'name1',
      'price' => '100',
      'grade' => '4.4'
   },
   array
   {
      'name' => 'name16',
      'price' => '12',
      'grade' => '1.2'
   },
   array
   {
      'name' => 'name3',
      'price' => '143',
      'grade' => '2.4'
   }
}

Is there any way to order this array by name or price or grade, so that the output would be for example: (ordered by name)

array
{
   array
   {
      'name' => 'name1',
      'price' => '100',
      'grade' => '4.4'
   },
   array
   {
      'name' => 'name3',
      'price' => '143',
      'grade' => '2.4'
   },
   array
   {
      'name' => 'name16',
      'price' => '12',
      'grade' => '1.2'
   }
}

usort with PHP.net #4'th example using a closure to sort a multi-dimensional array:

function build_sorter($key) {
    return function ($a, $b) use ($key) {
        return strnatcmp($a[$key], $b[$key]);
    };
}

usort($array, build_sorter('name'));
usort($array, build_sorter('price'));
usort($array, build_sorter('grade'));