Added array_undot() helper

This commit is contained in:
Deon George 2018-08-11 15:11:34 +10:00
parent 98b7b9f6a8
commit f8d7432965
No known key found for this signature in database
GPG Key ID: 7670E8DC27415254

View File

@ -13,3 +13,17 @@ if (! function_exists('is_json')) {
return (json_last_error() == JSON_ERROR_NONE); return (json_last_error() == JSON_ERROR_NONE);
} }
} }
// Inverse of array_dot()
if (! function_exists('array_undot')) {
function array_undot($dotNotationArray)
{
$array = [];
foreach ($dotNotationArray as $key => $value) {
array_set($array, $key, $value);
}
return $array;
}
}