Given this associative array:
$currencies = [
'foo' => [
'name' => 'EUR',
'symbol' => '€'
],
'bar' => [
'name' => 'USD',
'symbol' => '$'
],
'baz' => [
'name' => 'GBP',
'symbol' => '£'
],
];
How can I search for a name
and retrieve key in a concise manner? I.e. searching for EUR
returns foo
.
I could loop, but I'd prefer a shorter way, if it exists...
Thanks