我在操作和数组来过滤一些数据时遇到了麻烦。这是数组的一个示例:
Array
(
[0] => Array
(
[0] => Array
(
[accounts] => Array
(
[name] =>
)
[accounts] => Array
(
[id] => 84352
[a_id] => 552
[customer_number] => 1593428
[password] => asdasdasdasd
[completed] =>
[created_date] => 2012-04-11 01:00:03.429465
[expiration_date] => 2012-10-11 09:45:12.100404
)
)
)
[1] => Array
(
[1] => Array
(
[users] => Array
(
[name] =>
)
[accounts] => Array
(
[id] => 106101
[a_id] => 574
[customer_number] => 429381
[password] => dsadasdsdad
[completed] =>
[created_date] => 2012-09-08 15:40:44.702644
[expiration_date] => 2012-09-22 00:00:00
)
)
)
.....many more
我知道我需要使用嵌套的 foreach 循环,但困难的部分是我想解析name
它是否为空白,并且我还想清理日期以使其看起来更好。有谁知道我怎么能做到这一点?它几乎是循环数组并复制它们的数组,但修改某些元素。谢谢!