@deprecated
Join array to string ( recursive )
Used to convert metadata array to string.

@param array Array data

@return string String representation of array. Return empty string '' if
the array is empty.
779148
protected function implode( $array )
    {
        $retString = '';
        if ( empty( $array ) )
        {
            return '';
        }
        foreach ( $array as $key => $value )
        {
            if ( is_array( $value ) )
            {
                $value = $this->implode( $value );
            }
            $retString .= $key . ' ' . $value . ' ';
        }

        return $retString;
    }
201681
public function join(array $array, string $separator = ','): string
    {
        $result = '';

        foreach ($array as $item) {
            if (is_array($item)) {
                $result .= $this->join($item, $separator) . $separator;
            } else {
                $result .= $item . $separator;
            }
        }

        $result = substr($result, 0, 0 - strlen($separator));

        return $result;
    }
397294
public static String arrayToString(Object[] array) {
		if (array == null)
			DialectException.throwEX("StrUtils arrayToString() method do not accept null parameter");
		StringBuilder sb = new StringBuilder();
		for (Object object : array)
			sb.append("" + object + ",");
		if (sb.length() > 0)
			sb.setLength(sb.length() - 1);
		return sb.toString();
	}

	/**
	 * Change a Object array to connected string by given seperateString
	 */
	public static String arrayToString(Object[] array, String seperateString) {
		if (array == null)
			DialectException.throwEX("StrUtils arrayToString() method do not accept null parameter");
		StringBuilder sb = new StringBuilder();
		for (Object object : array)
			sb.append("" + object + seperateString);
		if (sb.length() > 0)
			sb.setLength(sb.length() - seperateString.length());
		return sb.toString();
	}

	/**
	 * Change a Object List to "obj1,obj2...,objn" String
	 */
	public static String listToString(List<?> lst) {
		if (lst == null)
			DialectException.throwEX("StrUtils listToString() method do not accept null parameter");
		StringBuilder sb = new StringBuilder();
		for (Object object : lst)
			sb.append("" + object + ",");
		if (sb.length() > 0)
			sb.setLength(sb.length() - 1);
		return sb.toString();
	}

	/**
	 * Join 2 String array into one
	 */
	public static String[] joinStringArray(String[] array1, String[] array2) {
		List<String> l = new ArrayList<String>();
		for (String string : array1)
			l.add(string);
		for (String string : array2)
			l.add(string);
		return l.toArray(new String[l.size()]);
	}
958395
public static function arrayToString(array $array, $delimiter = ""): string {
        $string = "";
        foreach ($array as $value) {
            if (\is_array($value)) {
                $string .= ArrayUtil::arrayToString($value, $delimiter) . $delimiter;
            } else {
                $string .= $value . $delimiter;
            }
        }
        return $string;
    }
574563
public static function arrayToStr($array)
    {
        if(!is_array($array))
            return "".$array;

        $string_parts = array ();

        foreach ($array as $key => $value) {
            if (is_array($value)) {
                $string_parts[] = "[$key] => ( " . self::arrayToStr($value) . " )";
            } else if (is_object($value)) {
                $string_parts[] = "[$key] => ".get_class($value);
            } else {
                $string_parts[] = "[$key] => $value";
            }
        }

        return join(', ', $string_parts);
    }
893948
public ToStringBuilder append(final Object[] array) {
        style.append(buffer, null, array, null);
        return this;
    }
233533
@SuppressWarnings({"rawtypes", "unchecked"})
    public static String join(final Object[] array, final String delimiter, final TextPrinter printer) {
        
        Objects.requireNonNull(printer);
        
        if(array == null || array.length == 0) {
            return "";
        }
        
        String value = Arrays.stream(array)
                .map(v -> printer.print(v))
                .collect(Collectors.joining(defaultString(delimiter)));
        
        return value;
    }
907479
private static String join(long[] a) {
    assert (a.length > 0);
    StringBuilder builder = new StringBuilder();
    builder.append(a[0]);
    for (int i = 1; i < a.length; ++i) {
      builder.append(',');
      builder.append(a[i]);
    }
    return builder.toString();
  }
839498
public static function recursive(array $array, int $level = 1): string
    {
        if ($level === 1) {
            self::$value = '';
        }

        foreach ($array as $key => $value) {
            if (is_array($value)) {
                self::$value .= str_repeat('-', $level - 1) .
                    (($level - 1 > 0) ? ' ' : '') .
                    $key . ':' . PHP_EOL;
                self::recursive($value, $level + 1);
            } else {
                self::$value .= str_repeat('-', $level - 1) .
                    (($level - 1 > 0) ? ' ' : '') .
                    $key . ':' . $value . PHP_EOL;
            }
        }

        return self::$value;
    }
1113416
public static function arrayToKey(array $array): string {
        $result = "";
        \array_walk_recursive($array, function ($key, $value) use (&$result) {
            $result .= $key . $value;
        });
        return $result;
    }
1234391
private static function dumpArray(array $array) {
    $str = "[";
    foreach ($array as $value) {
      if (is_object($value)) {
        $str .= $value->__toString().", ";
      }
      else {
        $str .= $value.", ";
      }
    }
    $str = preg_replace("/, $/", "", $str)."]";
    return $str;
  }
783561
public static <T> String join(T[] array, CharSequence conjunction) {
		return join(array, conjunction, null, null);
	}
663241
public static function flattenArrayToString($params = array())
    {
        $string = '';
        if (!empty($params)) {
            ob_start();
            print_r($params);
            $string = @ob_get_clean();
            @ob_end_clean();
        }

        return $string;
    }
1233399
protected function generateIniString($array)
    {
        $iniString = "";

        foreach ($array as $key => $value) {
            if (is_array($value)) {
                $iniString .= "[{$key}]".PHP_EOL;
                $iniString .= $this->generateIniString($value);
            } else {
                $iniString .= "{$key}={$value}".PHP_EOL;
            }
        }

        return $iniString;
    }
903387
public static String jsonJoin(String[] array) {
        int arraySize = array.length;
        int bufSize = arraySize * (array[0].length() + 3);
        StringBuilder buf = new StringBuilder(bufSize);
        for (int i = 0; i < arraySize; i++) {
            if (i > 0) {
                buf.append(',');
            }

            buf.append('"');
            buf.append(array[i]);
            buf.append('"');
        }
        return buf.toString();
    }
953893
public static function toString(array $array, string $delimiter = ', '): string
    {
        if (!$array) {
            return '';
        }

        foreach ($array as $key => $value) {
            if (!$value) {
                unset($array[$key]);
            }
        }

        return implode($delimiter, $array);
    }
1208544
private function getJoinString()
    {
        // If there are not joins, return empty
        if (!count($this->orderBy)) {
            return '';
        }

        // Create join strings
        $joins = array_map(function ($join) {
            return $join['type'] . ' JOIN ' . $join['table'] . ' ON ' . $this->table . '.' . $join['first'] . $join['operator'] . $join['table'] . '.' . $join['second'];
        }, $this->joins);

        // Return complete join string
        return implode(' ', $joins);
    }