Skip to content
Advertisement

Using array_search for multi value search

JavaScript

This works fine, but is there a way to search using multiple values: eg. get key where name='flash' && type='camera' ?

Advertisement

Answer

is there a way to search using multiple values: eg. get key where name=’flash’ && type=’camera’ ?

Simply with array_keys function:

JavaScript

The output:

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