public function convertArrayToDotNotation(array $array)
    {
        $recursiveIterator = new \RecursiveIteratorIterator(new \RecursiveArrayIterator($array));

        $newArray = [];

        foreach ($recursiveIterator as $leafValue) {
            $keys = [];

            foreach (range(0, $recursiveIterator->getDepth()) as $depth) {
                $keys[] = $recursiveIterator->getSubIterator($depth)->key();
            }

            $newArray[implode('.', $keys)] = $leafValue;
        }

        return $newArray;
    }
public function convertArrayToDotNotation(array $array)
    {
        $recursiveIterator = new \RecursiveIteratorIterator(new \RecursiveArrayIterator($array));

        $newArray = [];

        foreach ($recursiveIterator as $leafValue) {
            $keys = [];

            foreach (range(0, $recursiveIterator->getDepth()) as $depth) {
                $keys[] = $recursiveIterator->getSubIterator($depth)->key();
            }

            $newArray[implode('.', $keys)] = $leafValue;
        }

        return $newArray;
    }
public function convertArrayToDotNotation ( array $ array ) { $ recursiveIterator = new \ RecursiveIteratorIterator ( new \ RecursiveArrayIterator ( $ array ) ) ; $ newArray = [ ] ; foreach ( $ recursiveIterator as $ leafValue ) { $ keys = [ ] ; foreach ( range ( 0 , $ recursiveIterator -> getDepth ( ) ) as $ depth ) { $ keys [ ] = $ recursiveIterator -> getSubIterator ( $ depth ) -> key ( ) ; } $ newArray [ implode ( '.' , $ keys ) ] = $ leafValue ; } return $ newArray ; }
Convert an array with nested arrays into a dot notation array.

@param  array $array

@return array
Convert an array with nested arrays into a dot notation array .