laravel/framework — pull request #5663 by danielsum (2014-09-05 13:07:59+00:00)
Title: Add the opposite of array_dot

Seems that I cannot find the opposite of the array_dot helpers so I made this very practical little helper to help me to transform an array with dot notation to a multidimensional object :

Ex :

$arrayDotted = [
'name' => 'name'
'data.categories.0' => 'cat-0',
'data.categories.1' => 'cat-1',
'data.location.name' => 'location name'
];

$response = dot_array($arrayDotted);

Will return a response like :

[
'name' => 'name'
'data' => [
'categories' => ['cat-0', 'cat-1'],
'location' => ['name' => 'location name']
];

The dot notation is very practical to flatten a multidimensional array with this helper you can use it in the opposite for example if you have data from a csv that you cannot have in a multidimensional way => you can use the dot notation an dot_array to handle this.