diff --git a/src/helpers.php b/src/helpers.php index ef145a1..765efaa 100644 --- a/src/helpers.php +++ b/src/helpers.php @@ -12,4 +12,18 @@ if (! function_exists('is_json')) { 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; + } } \ No newline at end of file