我有一个数组。
Array
(
[0] => Array
(
[TotalClicksPerDay] => 5
[Date] => 2012-11-26
[weekDay] => 2
)
[1] => Array
(
[TotalClicksPerDay] => 13
[Date] => 2012-11-27
[weekDay] => 6
)
)
我想通过使用值 [weekday] 作为键来重新定义键。
因此,在上面的示例中,新数组将如下所示:
Array
(
[2] => Array
(
[TotalClicksPerDay] => 5
[Date] => 2012-11-26
[weekDay] => 2
)
[6] => Array
(
[TotalClicksPerDay] => 13
[Date] => 2012-11-27
[weekDay] => 6
)
)