0 =>
array =>
'orderno' => '150228085016'
'delivery_time' => '1425124096'
'create_time' => '1425174370'
1 =>
array =>
'orderno' => '150228084786'
'delivery_time' => '1425124096'
'create_time' => '1425174374'
2 =>
array =>
'orderno' => '150228090539'
'delivery_time' => '1425123584'
'create_time' => '1425174387'
数组如上,我想使用对每组数组中的delivery_time 和 create_time键使用Date函数,得出结果如下:
0 =>
array =>
'orderno' => '150228085016'
'delivery_time' => '2015-03-11'
'create_time' => '2015-03-11'
1 =>
array =>
'orderno' => '150228084786'
'delivery_time' => '2015-03-11'
'create_time' => '2015-03-11'
2 =>
array =>
'orderno' => '150228090539'
'delivery_time' => '2015-03-11'
'create_time' => '2015-03-11'
除了循环之外,PHP数组有没有内置的方法?
array_map
假设你上面那个数组叫 $a...
array_column是5.5才支持的函数;需要向下兼容。
使用array_walk_recursive处理,会完美解决你的问题~~