从PHP中的数组中删除元素

送分小仙女□ 提交于 2020-08-17 18:28:23

问题:

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
标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!