public static function get($array, $key, $default = null)
{
$key = static::normalizeKey($key);
if ($key === null || $key === '') {
return $array;
}
$keys = explode('.', $key);
$currentElement = $array;
foreach ($keys as $currentKey) {
if (!is_array($currentElement) || !array_key_exists($currentKey, $currentElement)) {
return $default;
}
$currentElement = $currentElement[(string) $currentKey];
}
return $currentElement;
}