There are multiple ways to delete an element from array with PHP: unset, array_splice, and array_diff. The splice method is very similar to my article on removing a specific element with JavaScript article.
Tag: splice
-
JavaScript – Remove a specific element from an array
It’s quite often that I have an array of elements and when a certain condition happens that I need to remove a particular element from my JavaScript array. Let’s explore how indexOf and splice accomplish this.