0
添加額外的信息到它的項目我有一個下列items
陣列:遍歷數組和PHP
Array
(
[0] => Array
(
[id] => 7
[name] => Item no 1
[created] => 2016-05-11 16:51:15
)
[1] => Array
(
[id] => 9
[name] => Item no 2
[created] => 2016-05-11 17:02:27
)
)
我需要做的是迭代陣列和價值過來。爲了簡單起見,我想添加status
,它等於1
。
我已經creted這個簡單的foreach,但沒有被添加的狀態:
foreach($items as $item){
$item['status'] = '1';
}
我怎麼能得到這個工作?