php how to remove from an array
Possible Duplicate:
How to delete an element from an array in php?
best way to delete array item in PHP?
I was trying to find the correct method for removing an array item in php. I have an array such that;
ArrayItems[item1[], item2[]....]
and i need to remove one of the items.
I have tried using unset($item1)
but to no avail. Are there any other methods for doing this?
Thanks
unset
is the correct thing to use, but like this:
unset($myArray[$myIndex]);
Demo: http://codepad.org/99oulHKe
链接地址: http://www.djcxy.com/p/30110.html上一篇: 从数组中删除
下一篇: PHP如何从数组中删除