public static function toString($array = null, $inner_glue = '=', $outer_glue = ' ', $keepOuterKey = false)
    {
        $output = array();

        if ($array instanceof AnConfig) {
            $data = array();
            foreach ($array as $key => $item) {
                $data[$key] = (string) $item;
            }
            $array = $data;
        }

        if (is_object($array)) {
            $array = (array) AnConfig::unbox($array);
        }

        if (is_array($array)) {
            foreach ($array as $key => $item) {
                if (is_array($item)) {
                    if ($keepOuterKey) {
                        $output[] = $key;
                    }
                    // This is value is an array, go and do it again!
                    $output[] = AnHelperArray::toString($item, $inner_glue, $outer_glue, $keepOuterKey);
                } else {
                    $output[] = $key.$inner_glue.'"'.str_replace('"', '&quot;', $item).'"';
                }
            }
        }

        return implode($outer_glue, $output);
    }