3 * @file src/Util/Arrays.php
4 * @author Roland Haeder<https://f.haeder.net/profile/roland>
6 namespace Friendica\Util;
9 * @brief Array utility class
14 * @brief Private constructor
16 private function __construct () {
17 // Utitlities don't have instances
21 * @briefs Implodes recursively a multi-dimensional array where a normal implode() will fail.
23 * @param array $array Array to implode
24 * @param string $glue Glue for imploded elements
25 * @return string String with elements from array
27 public static function recursiveImplode (array $array, $glue) {
28 // Init returned string
31 // Loop through all records
32 foreach ($array as $element) {
34 if (is_array($element)) {
36 $string .= '{' . self::recursiveImplode($element, $glue) . '}' . $glue;
39 $string .= $element . $glue;
44 $string = trim($string, $glue);