public static function flatten(array $set, $path = null) {
        if ($path) {
            $path = $path . '.';
        }

        $data = array();

        foreach ($set as $key => $value) {
            if (is_array($value)) {
                if ($value) {
                    $data += static::flatten($value, $path . $key);
                } else {
                    $data[$path . $key] = null;
                }
            } else {
                $data[$path . $key] = $value;
            }
        }

        return $data;
    }
public static function flatten(array $set, $path = null) {
        if ($path) {
            $path = $path . '.';
        }

        $data = array();

        foreach ($set as $key => $value) {
            if (is_array($value)) {
                if ($value) {
                    $data += static::flatten($value, $path . $key);
                } else {
                    $data[$path . $key] = null;
                }
            } else {
                $data[$path . $key] = $value;
            }
        }

        return $data;
    }
public static function flatten ( array $ set , $ path = null ) { if ( $ path ) { $ path = $ path . '.' ; } $ data = array ( ) ; foreach ( $ set as $ key => $ value ) { if ( is_array ( $ value ) ) { if ( $ value ) { $ data += static :: flatten ( $ value , $ path . $ key ) ; } else { $ data [ $ path . $ key ] = null ; } } else { $ data [ $ path . $ key ] = $ value ; } } return $ data ; }
Flatten a multi-dimensional array by returning the values with their keys representing their previous pathing.

@param array $set
@param string $path
@return array
Flatten a multi - dimensional array by returning the values with their keys representing their previous pathing .