0
Array
(
[0] =Array
    (
        [id] =3
        [title] =Tst topic 111 main
        [created] =2012-11-06 13:04:57
        [sticked] = 
        [forums_id] =1
        [status] =open
    )

[1] =Array
    (
        [id] =6
        [title] =Topic 222 Main
        [created] =2012-11-04 15:31:15
        [sticked] = 
        [forums_id] =1
        [status] =open
    )

[2] =Array
    (
        [id] =7
        [title] =dfgdfgdfg
        [created] =2012-11-19 13:27:10
        [sticked] =
        [forums_id] =1
        [status] =open
    )

[3] =Array
    (
        [id] =9
        [title] =sdf ertert ertwer
        [created] =2012-11-20 11:30:55
        [sticked] =2012-11-20 11:30:00
        [forums_id] =1
        [status] =&close
    )

[4] =Array
    (
        [id] =10
        [title] =345245
        [created] =2012-11-20 11:34:17
        [sticked] =2012-11-20 11:34:00
        [forums_id] =&1
        [status] =open
    )

)


这是我的结果多维数组。其中一些主题具有sticked带有日期时间戳的字段。我想先用sticked字段(DESC 顺序)对这个数组进行排序,然后所有粘贴的主题都将位于数组的顶部。然后我想用它们的字段对所有具有 DESC 顺序的空粘贴字段的数组进行排序created
可能吗 ?
我期待的顺序是[4] - [3] - [2] - [0] - [1]

4

2 回答 2

0

请参阅此页面:

PHP数组排序函数

http://php.net/manual/en/array.sorting.php

于 2012-11-20T06:54:54.597 回答
-1

仅将此行添加到您的代码中

$final=arsort($yourarray);
print_r($final);

或者您可以在Link上查看帮助

愿它有帮助!!

于 2012-11-20T06:59:39.927 回答