Implodes a single dimension array using pipes (|)
Multi dimensional arrays are not allowed.
@return string
357264
protected function encodeArrayValue($data, $delimeter = '|')
    {
        $newData = [];
        foreach ($data as $value) {
            if (is_array($value)) {
                $newData[] = 'Array';
            }
            else {
                $newData[] = str_replace($delimeter, '\\'.$delimeter, $value);
            }
        }

        return implode($delimeter, $newData);
    }
174282
protected function implodeSQL(array $parts): string
    {
        $result = '';
        foreach ($parts as $part) {
            if ($part === '') {
                continue;
            }

            $result .= ($result === '' ? '' : "\n").$part;
        }

        return $result;
    }
310564
public function getSentHeaders()
    {
        $compiledHeaders = [];

        foreach ($this->headers as $header)
        {
            $compiledHeaders[] = (string) $header;
        }

        return implode("\n", $compiledHeaders);
    }
664682
protected function acceptableFormatted()
    {
        if (!is_array($this->acceptable)) {
            return '';
        }

        $acceptable = array_map([$this, 'acceptableItemFormatted'], $this->acceptable);

        return '[' . implode('/', $acceptable) . ']';
    }
1057258
public function getStringifiedArray(): array
    {
        $ret = [];
        foreach ($this->headers as $header => $value) {
            if (is_array($value)) {
                $value = implode(", ", $value);
            }
            $ret[] = "$header: $value";
        }
        return $ret;
    }
1364692
public function __tostring ()
    {
        if (is_null($this->queryElements))
        {
            return "";
        }

        $query = [];

        foreach ($this->queryElements as $soqlKey => $value)
        {
            $value = (is_array($value)) ? implode(self::DELIMITER, $value) : $value;

            $query[] = sprintf("%s=%s", $soqlKey, $value);
        }

        return implode("&", $query);
    }
939166
public static function implode($array, $separator = " > ")
    {
        if ($array === null) {
            return "";
        }

        $elements = [];
        foreach($array as $rawElement) {
            $element = self::sanitizeString($rawElement);

            if ($element !== null) {
                $elements[] = $element;
            }
        }

        return implode($separator, $elements);
    }
1092611
protected function toString(): string
    {
        $normalized = sprintf('%s%s', $this->prefix, implode(DIRECTORY_SEPARATOR, $this->stack));

        return trim($normalized);
    }
457526
public function render()
    {
        $output[] = $this->open();

        if ($this->hasChildNodes()) {
            $output[] = implode(PHP_EOL, $this->childNodes->getArrayCopy());
        }

        if ($this->hasTextContent()) {
            $output[] = implode('', $this->textContent->getArrayCopy());
        }

        $output[] = $this->close();

        return implode(PHP_EOL, $output);
    }
1064018
public function getSortString() {
    $sort = $this->getSort();
    $sortString = array();
    if (is_array($sort) && !empty($sort)) {
      foreach ($sort as $k => $v) {
        $sortString[] = $v . $k;
      }
    }
    return implode(";", $sortString);
  }
417750
public function character()
    {
        $rows = [];
        $rows[] = ' ' . str_repeat('-', $this->width);
        for ($y = 0; $y < $this->height; $y++) {
            $row = '|';
            for ($x = 0; $x < $this->width; $x++) {
                $row .= $this->space($x, $y)->character();
            }
            $row .= '|';
            $rows[] = $row;
        }
        $rows[] = ' ' . str_repeat('-', $this->width);
        return implode("\n", $rows) . "\n";
    }
518453
static function build_line($array)
    {
        if (self::$data_sep)
        {
            $line = '';
            foreach ($array as $k => $v)
            {
                $line .= $k . self::$data_sep . $v . self::$col_sep;
            }
            return rtrim($line, self::$col_sep);
        }
        else
        {
            return implode(self::$col_sep, $array);
        }
    }
1093868
static public function stringify(array $array)
    {
        $result = array();
        foreach ($array as $key => $value) {
            $result[] = sprintf('%s=%s', $key, $value);
        }
        return implode('&', $result);
    }
1318490
public function normalize()
    {
        $data = $this->get();
        if (is_array($data)) {
            $data = implode($this->separator, $data);
        }
        $data = trim($data, $this->separator);
        if (!$data) {
            $data = null;
        }

        if (get_magic_quotes_gpc()) {
            $this->set(stripslashes($data));
        } else {
            $this->set($data);
        }

        return parent::normalize();
    }
853321
public static function arrayToString(array $array = [], $delimiter = ' ')
    {
        $pairs = [];
        foreach ($array as $key => $value) {
            $pairs[] = "$key=\"$value\"";
        }

        return implode($delimiter, $pairs);
    }
312210
protected function _arrayToString($data)
    {
        $fields = array();
        foreach($data as $value)
        {
            //Implode array's
            if(is_array($value)) {
                $value = implode(',', $value);
            }

             // Escape the quote character within the field (e.g. " becomes "")
            if ($this->_quoteValue($value))
            {
                $quoted_value = str_replace($this->quote, $this->quote.$this->quote, $value);
                $fields[] 	  = $this->quote . $quoted_value . $this->quote;
            }
            else $fields[] = $value;
        }

        return  implode($this->separator, $fields);
    }
111740
protected function implodeParams(array $params)
    {
        $s = '';

        foreach ($params as $header => $value) {
            $s .= trim($header) . ": " . trim($value) . "\r\n";
        }

        return $s;
    }