Skip to content
Advertisement

Using array_keys to search a multidimensional array with a partial array

JavaScript

As shown in the code above, I’d like to be able to quickly find an array in a multidimensional array but only specify two of the values.

Advertisement

Answer

One way to do this is to filter the testArray down to those number of keys using array_map, then use array_search to get the key.

JavaScript
User contributions licensed under: CC BY-SA
9 People found this is helpful
Advertisement