I have an array looking like this:
$user = array();
$user['albert']['email'] = '[email protected]';
$user['albert']['someId'] = 'foo1';
$user['berta']['email'] = '[email protected]';
$user['berta']['someId'] = 'bar2';
Now I want to find out which user has a certain someId. In this example I want to know who has the someId bar2 and want the result berta. Is there a decent php function for this or would I have to create this on my own?
idas the key of the array which would allow you to retrieve the data for a given record by simply using the key directly? e.g.$username = $user[$id]['name']. This seems the more logical way to structure your data and how a database is likely to index the records.someIdinstead ofid, possibly should have picked more concrete names for this example though.