Convert an array of key-value pairs to a string of the form (a=b; c=d)

@param array $kv

@return string
327137
public static function kvToRequestString(array $kv): string
    {
        $r = '';
        foreach ($kv as $k => $v) {
            $r .= $k . '=' . $v . '; ';
        }
        $r = rtrim($r, '; ');

        return $r;
    }
1057437
public function serializePHP($array)
    {
        $raw = '';
        $line = 0;
        $keys = array_keys($array);

        foreach ($keys as $key) {
            $value = $array[$key];
            $line++;
            $raw .= $key . '|';
            if (is_array($value) && isset($value['huge_recursion_blocker_we_hope'])) {
                $raw .= 'R:' . $value['huge_recursion_blocker_we_hope'] . ';';
            } else {
                $raw .= serialize($value);
            }
            $array[$key] = array('huge_recursion_blocker_we_hope' => $line);
        }

        return $raw;
    }
921420
protected function getKeyString()
    {
        $expected = $this->expected;
        $keys = '';
        $tail = array_pop($expected);

        if (!empty($expected)) {
            $keys = implode('","', $expected) . '", and "';
        }

        $keys .= $tail;

        return $keys;
    }
997559
public static function intArrayToString(array $integers): string
    {
        $args = $integers;
        foreach ($args as $i => $v) {
            $args[$i] = (int) ($v & 0xff);
        }
        return \pack(
            \str_repeat('C', \count($args)),
            ...$args
        );
    }
925653
public function arrayStringKeys(Array_ $array)
    {
        $keys = [];
        foreach ($array->items as $item) {
            if ($item->key instanceof String_) {
                $keys[] = $item->key->value;
            }
        }

        return $keys;
    }
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;
    }
1073123
public static function getString(array $array, $key, string $default = '') : string
    {
        $key = (string) $key;

        if ($array[$key] ?? 0) {
            return (string) $array[$key];
        }

        return $default;
    }
1171639
public function toString()
    {
        $options = $this->toArray();

        //Transforms values as strings
        array_walk($options, function (&$value, $key) {
            if (is_array($value)) {
                $value = implode(' ', $value);
            } elseif (is_bool($value)) {
                $value = $value ? 'true' : 'false';
            } elseif (is_null($value)) {
                $value = 'null';
            }

            $value = $key . '="' . $value . '"';
        });

        return implode(' ', $options);
    }
10900
public static function arrayToString(array $values): string
    {
        if (self::ZERO == $values[0]) {
            $values[0] = '';
        }
        if (self::INFINITE == $values[1]) {
            $values[1] = '';
        }

        return implode(self::SEPARATOR, $values);
    }
728670
public function mGet(array $keyArray)
    {
        $result = [];
        foreach ($keyArray as $key) {
            $v = $this->get($key);
            if (null != $v) {
                $result[$key] = $v;
            }
        }

        return $result;
    }
680481
public static function convertStringToValueArray(array $array): array
    {

        foreach ($array as $i => $attr)
            $array[$i] = (is_array($attr) ? self::convertStringToValueArray($attr) : self::convertStringToValues($attr));

        return $array;
    }
828283
private static function keyString($key): string
    {
        return $key === null || is_scalar($key)
            ? (string) $key
            : (is_object($key) ? spl_object_hash($key) : self::arrayKeyString($key));
    }
467144
public static function compileAttributeStringFromArray(array $array): string
    {
        $attributeString = '';

        foreach ($array as $key => $value) {
            if (null === $value || (\is_bool($value) && $value)) {
                $attributeString .= "$key ";
            } else if (!\is_bool($value)) {
                $attributeString .= "$key=\"$value\" ";
            }
        }

        return $attributeString ? ' ' . $attributeString : '';
    }
293126
public static function keyFlattening($array, $keys = []) {
		if (is_array($array)) {
			$result = [];
			foreach ($array as $key => $value) {
				$tmp_keys = $keys;
				$tmp_keys [] = $key;
				$result = array_merge($result, static::keyFlattening($value,$tmp_keys));
			}
			return $result;
		}

		$key = array_shift($keys);
		return [
			empty($keys) ? $key : sprintf('%s[%s]', $key, implode ('][', $keys)) => $array,
		];
	}
1295173
public function convertArrayToDotNotation(array $array)
    {
        $recursiveIterator = new \RecursiveIteratorIterator(new \RecursiveArrayIterator($array));

        $newArray = [];

        foreach ($recursiveIterator as $leafValue) {
            $keys = [];

            foreach (range(0, $recursiveIterator->getDepth()) as $depth) {
                $keys[] = $recursiveIterator->getSubIterator($depth)->key();
            }

            $newArray[implode('.', $keys)] = $leafValue;
        }

        return $newArray;
    }
1239053
protected function arrayToKey(array $array)
    {
        if ($this->isSequential($array)) {
            return $this->sequentialArrayToKey($array);
        }

        $parts = [];

        $keys = array_keys($array);
        sort($keys);

        foreach ($keys as $key) {
            $parts[] = $key;
            $parts[] = $this->castArrayValue($array[$key]);
        }

        return implode('_', $parts);
    }
1051613
public static function toAttributeString(array $arr = null): string
    {
        $ret = "";
        if ($arr !== null) {
            foreach ($arr as $k => $v) {
                $ret .= " $k=\"$v\"";
            }
        }
        return $ret;
    }