如何基于PHP中的值对数组进行排序

问题描述:



数组



[0] =>数组



[0] => 2017-03-05 00:00:39

[1] => ABCD

[2] => 1234



[1] =>数组



[0] => 2017- 03-05 00:00:39

[1] => EFGH

[2] => 42342



[2] =>数组



[0] => 2017-03-07 00:00:39

[1] => ABCD

[2] => 331242493



[3] =>数组 b $ b(

[0] => 2017-03-07 00:00:39

[1] => EFGH

[2] => 46656



[4] =>数组



[0] => 2017-03-06 00:00:39

[1] => ABCD

[2] => 7676



[5] =>数组



[0] => 2017-03-06 00:00:39

[1] => EFGH

[2] => 98989





我需要获得所有的值在数组中索引为'ABCD'并根据日期时间(第0个索引)对结果进行排序。

我的输出应为此值:

[0] =>数组



[0] => 2017-03-07 00:00:39

[1] => ABCD

[2] => 331242493



请帮忙。

提前致谢



我尝试过:



$ array = array();

for($ polIndex = 0; $ polIndex< count($ pol_array); $ polIndex ++)//循环从pol项目获取物品

{

$ array = preg_grep(ABCD,$ pol_array,PREG_GREP_INVERT);

}

Hi,
Array
(
[0] => Array
(
[0] => 2017-03-05 00:00:39
[1] => ABCD
[2] => 1234
)
[1] => Array
(
[0] => 2017-03-05 00:00:39
[1] => EFGH
[2] => 42342
)
[2] => Array
(
[0] => 2017-03-07 00:00:39
[1] => ABCD
[2] => 331242493
)
[3] => Array
(
[0] => 2017-03-07 00:00:39
[1] => EFGH
[2] => 46656
)
[4] => Array
(
[0] => 2017-03-06 00:00:39
[1] => ABCD
[2] => 7676
)
[5] => Array
(
[0] => 2017-03-06 00:00:39
[1] => EFGH
[2] => 98989
)
)
I need to get all the values that has 1st index as 'ABCD' in an array and sort the result based on the datetime (0th index).
My output should be this value :
[0] => Array
(
[0] => 2017-03-07 00:00:39
[1] => ABCD
[2] => 331242493
)
Please help.
Thanks in advance

What I have tried:

$array=array();
for($polIndex=0;$polIndex < count($pol_array);$polIndex++)//loop for getting items from pol item
{
$array = preg_grep("ABCD", $pol_array, PREG_GREP_INVERT);
}

array = array();

for(
array=array();
for(


polIndex = 0;
polIndex=0;


polIndex< count(
polIndex < count(