gpt4 book ai didi

PHP按字段排序数组?

转载 作者:IT王子 更新时间:2023-10-29 01:03:35 32 4
gpt4 key购买 nike

<分区>

Possible Duplicate:
how to sort a multidemensional array by an inner key
How to sort an array of arrays in 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'
);

那么数据是根据数组中的标题字段ASC 顺序显示的吗?

32 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com