protected static function flattenRecursive(&$recursion, $prefix)
    {
        $values = [];

        foreach ($recursion as $key=>&$value)
        {
            if (is_array($value) && !empty($value))
            {
                $values = array_merge($values, static::flattenRecursive($value, $prefix . $key . '.'));
            }
            else
            {
                $values[$prefix . $key] = $value;
            }
        }

        return $values;
    }
protected static function flattenRecursive(&$recursion, $prefix)
    {
        $values = [];

        foreach ($recursion as $key=>&$value)
        {
            if (is_array($value) && !empty($value))
            {
                $values = array_merge($values, static::flattenRecursive($value, $prefix . $key . '.'));
            }
            else
            {
                $values[$prefix . $key] = $value;
            }
        }

        return $values;
    }
protected static function flattenRecursive ( & $ recursion , $ prefix ) { $ values = [ ] ; foreach ( $ recursion as $ key => & $ value ) { if ( is_array ( $ value ) && ! empty ( $ value ) ) { $ values = array_merge ( $ values , static :: flattenRecursive ( $ value , $ prefix . $ key . '.' ) ) ; } else { $ values [ $ prefix . $ key ] = $ value ; } } return $ values ; }
Flatten a single recursion of array.

@param array $recursion
@param string $prefix
@return array
Flatten a single recursion of array .