可能是重复:
如何按内部键排序多维数组
如何在php中对数组进行排序?
如何对类似于$array[$i]['title']
的数组进行排序?
数组结构可能像这样:
array[0] (
'id' => 321,
'title' => 'Some Title',
'slug' => 'some-title',
'author' => 'Some Author',
'author_slug' => 'some-author'
);
array[1] (
'id' => 123,
'title' => 'Another Title',
'slug' => 'another-title',
'author' => 'Another Author',
'author_slug' => 'another-author'
);
所以数据是按照数组中的标题字段以 升序 显示的吗?