I have an array like the following:
$array = array( 0 => array( 'user' => 1, 'name' => 'Name 1', ), 1 => array( 'user' => 2, 'name' => 'Name 2', ), 2 => array( 'user' => 3, 'name' => 'Name 3', ), );
I want to get the name value from the above array for given user value, but without using loops, if it is possible -I know how to do it with loops-. In other words, return the value of name for the given value of user.
Ex: I will give 2 as the user value, and I want to get Name 2. Or, I will give 3 as user value, and I want to get Name 3.
Is this possible without using loops? Maybe with array functions or something.