Returns the value in a nested associative structure
- keys
- Keys of the value to be returned.
- elements
- Elements to search in.
- default
- Default value to return in the case that the key not exists (`null` if not provided).
Extract the email from a nested structure:
<?php
use function Lambdish\Phunctional\get_in;
$user = [
'username' => 'myfakeuser',
'profile' => ['name' => 'My Name', 'surname' => 'My Surname', 'email' => 'myfakeemail@gmail.com']
];
return get_in(['profile', 'email'], $user);
// => 'myfakeemail@gmail.com'