2012-04-08 71 views
1

可能重複:
How to delete an element from an array in php?
best way to delete array item in PHP?PHP如何從一個數組中刪除

我試圖找到在PHP去除數組項的正確方法。我有一個這樣的數組;

ArrayItems[item1[], item2[]....]

,我需要刪除的項目之一。

我試過使用unset($item1)但無濟於事。有沒有其他方法可以做到這一點?

感謝

+1

http://stackoverflow.com/questions/369602/how-to-從數組中刪除元素在 – ShinTakezou 2012-04-08 09:54:58

+0

可能的重複[在PHP中刪除數組項的最佳方法?](http://stackoverflow.com/questions/1748006/best-way-to-delete -array-item-in-php)和[如何刪除數組中的索引X處的項目?](http://stackoverflow.com/q/48 60447/218196)和[php從數組中刪除元素](http://stackoverflow.com/q/9945534/218196)和[從數組中刪除](http://stackoverflow.com/q/5124194/218196)和[如何從PHP中的數組中刪除元素?](http://stackoverflow.com/questions/369602/how-to-delete-an-element-from-an-array-in-php)。 – 2012-04-08 09:55:12

+0

在提出新問題之前,請[使用搜索](http://stackoverflow.com/search?q=php+delete+element+from+array)。 – 2012-04-08 09:59:42

回答