rapidwebltd/array_undot
| Install | |
|---|---|
composer require rapidwebltd/array_undot |
|
| Latest Version: | v1.0.1 |
| License: | LGPL-3.0-only |
| Last Updated: | Jul 18, 2026 |
| Links: | GitHub · Packagist |
array_undot
[!WARNING] This package is retired and no longer maintained. Use
jord-jd/array_undotinstead. The maintained successor supports current PHP versions and preserves thearray_undot()API.
This package provides a helper function called array_undot, which expands a dot notation array into a full multi-dimensional array.
It is, therefore, the opposite of the array_dot helper function provided by Laravel.
Installation
To install, just run the following composer command.
composer require rapidwebltd/array_undot
The array_undot helper function will then be available globally in your project.
Usage
The following basic examples show how to use the array_undot helper function.
$dotNotationArray = ['products.desk.price' => 100];
$expanded = array_undot($dotNotationArray)
// ['products' => ['desk' => ['price' => 100]]];
$dotNotationArray = ['products.desk.price' => 100,
'products.desk.name' => 'Oak Desk',
'products.lamp.price' => 15,
'products.lamp.name' => 'Red Lamp'];
$expanded = array_undot($dotNotationArray)
/*
[
'products' => [
'desk' => [
'price' => 100,
'name' => 'Oak Desk'
],
'lamp' => [
'price' => 15,
'name' => 'Red Lamp'
]
]
]
*/
Related Packages
Powerful PHP database abstraction layer (DBAL) with many features for database s...
Laravel Serializable Closure provides an easy and secure way to serialize closur...
Cli error handling for console/command-line PHP applications.