Has the array method used to filter nested associative array in PHP?
For example:
I want to remove any more empty value - the first element in this example.
I know that array_filter will have to do something with a similar array, but can not find anything other than looping and besides creating my own new array, if it is the best solution then ok, I myself I can do this. I just did not want to ignore a built-in method for this.
$ myArray = array_filter ($ myArray, function ($ el) {return! Empty $ El ['key1']);});
No comments:
Post a Comment