Skip to content

Latest commit

 

History

History
40 lines (26 loc) · 588 Bytes

array_inflate.md

File metadata and controls

40 lines (26 loc) · 588 Bytes

Description

Expands a flattened array back into a nested array.

This will not work on flattened arrays where the keys were not kept.

array_inflate(array $array): array

Parameters

array

The input array

Returns

Returns a copy of the array inflated so that any keys using dot notation become nested arrays instead

Examples

Example # 1 Example uses of array_inflate()

$array = ['a' => 1, 'b.a' => 2, 'b.b' => 3];
print_r(array_inflate($array));

The above example will output:

Array
(
    [a] => 1
    [b.a] => 2
    [b.b] => 3
)