$item) { if (is_array($item)) { if ($keepOuterKey) { $output[] = $key; } // This is value is an array, go and do it again! $output[] = static::toString($item, $innerGlue, $outerGlue, $keepOuterKey); } else { $output[] = $key . $innerGlue . '"' . htmlspecialchars($item, ENT_COMPAT, 'UTF-8') . '"'; } } return implode($outerGlue, $output); } /** * Method to determine if an array is an associative array. * * @param array $array An array to test. * * @return boolean */ public static function isAssociative($array) { if (is_array($array)) { foreach (array_keys($array) as $k => $v) { if ($k !== $v) { return true; } } } return false; } }