php 如何把索引数组的下标改为具体的键值

把这个数组[0]=>Array([0]=>1436112000)[1]=>Array([0]=>1436716800)[2]=>Array([0]=>1436198400... 把这个数组
[0] => Array
(
[0] => 1436112000
)

[1] => Array
(
[0] => 1436716800
)

[2] => Array
(
[0] => 1436198400
)

[3] => Array
(
[0] => 1436284800
)

[4] => Array
(
[0] => 1435766400
)

[5] => Array
(
[0] => 1436371200
)

[6] => Array
(
[0] => 1435852800
)

[7] => Array
(
[0] => 1436457600
)

[8] => Array
(
[0] => 1435939200
)

[9] => Array
(
[0] => 1436544000
)
)
变成
[0] => Array
(
[today] => 1436112000
)

[1] => Array
(
[today] => 1436716800
)

[2] => Array
(
[today] => 1436198400
)

[3] => Array
(
[today] => 1436284800
)

[4] => Array
(
[today] => 1435766400
)

[5] => Array
(
[today] => 1436371200
)

[6] => Array
(
[today] => 1435852800
)

[7] => Array
(
[today] => 1436457600
)

[8] => Array
(
[today] => 1435939200
)

[9] => Array
(
[today] => 1436544000
)
)
求指教!!!!
展开
 我来答
liduabc2009
2015-07-29
知道答主
回答量:10
采纳率:0%
帮助的人:2.8万
展开全部
array_walk($a, function (&$value) {

foreach ($value as $k => $v) {

unset($value[$k]);

$value['today'] = $v;

}

});
推荐律师服务: 若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询

为你推荐:

下载百度知道APP,抢鲜体验
使用百度知道APP,立即抢鲜体验。你的手机镜头里或许有别人想知道的答案。
扫描二维码下载
×

类别

我们会通过消息、邮箱等方式尽快将举报结果通知您。

说明

0/200

提交
取消

辅 助

模 式