问题:
Is there an easy way to delete an element from an array using PHP, such that foreach ($array)
no longer includes that element? 有没有一种简单的方法可以使用PHP从数组中删除元素,以便foreach ($array)
不再包含该元素?
I thought that setting it to null
would do it, but apparently it does not work. 我认为将其设置为null
可以做到,但是显然不起作用。
解决方案:
参考一: https://stackoom.com/question/1Y9K/从PHP中的数组中删除元素参考二: https://oldbug.net/q/1Y9K/Deleting-an-element-from-an-array-in-PHP
来源:oschina
链接:https://my.oschina.net/u/3797416/blog/4297513