Returns stringified list
considering arrays inside of arrays

@param array $array The list to transform

@return string
769828
private function getList($array)
    {
        $list = array();
        foreach ($array as $key => $value) {
            $list[] = !is_array($value) ? $value : $this->getList($v);
        }

        return '(' . implode(' ', $list) . ')';
    }
1033343
private function arrayFilterRecursive(array &$array)
    {
        foreach ($array as $key => &$item) {
            is_array($item) && $array[$key] = $this->arrayFilterRecursive($item);
            if ($array[$key] === null ||
                $array[$key] === []
            ) {
                unset($array[$key]);
            }
        }
        return $array;
    }
434793
private static function arrayToFile($array) {
        $strFile = "<?php" . chr(13) . chr(10) . chr(13) . chr(10) . "return [" . chr(13) . chr(10);
        $strValue = \Sirgrimorum\CrudGenerator\CrudGenerator::arrayToFileWrite($array, 0);
        $strFile .= $strValue . "];";
        return $strFile;
    }
1336247
public function quoteArr(array $array)
    {
        $result = array();

        foreach ($array as $key => $item) {
            $result[$key] = $this->quote($item);
        }

        return $result;
    }
880218
public function flattenArray($array)
    {
        $result = [];
        foreach (array_dot($array) as $key => $value) {
            $splitKey = explode('.', $key);
            $newKey = $this->createArrayKey($splitKey);
            $result = array_merge($result, [$newKey => $value]);
        }

        return $result;
    }
1239289
public function packList(array $array)
    {
        $size = count($array);
        $b = $this->getListSizeMarker($size);
        foreach ($array as $k => $v) {
            $b .= $this->pack($v);
        }

        return $b;
    }
795570
protected function listifyAttr($array) {
        ksort($array);
        $list = array();
        foreach ($array as $name => $obj) {
            if ($obj === false) continue;
            $list[] = "$name&nbsp;=&nbsp;<i>" . $this->getClass($obj, 'AttrDef_') . '</i>';
        }
        return $this->listify($list);
    }
971878
public function transpose($array)
    {
        $return = [];

        if (count($array)) {
            foreach ($array as $key => $values) {
                foreach ($values as $subkey => $value) {
                    $return[$subkey][$key] = $value;
                }
            }
        }

        return $return;
    }
1181049
public function buildAttrFromArray(array $array)
    {
        $attributes = [];

        foreach ($array as $attribute => $data) {
            if (is_array($data)) {
                $data = implode(' ', $data);
            }

            $attributes[] = $attribute . '="' . htmlspecialchars($data) . '"';
        }

        return $attributes ? ' ' . implode(' ', $attributes) : '';
    }
615820
public function expandArray($array)
    {
        $retval = "";
        for ($i = 0; $i < count($array); $i++) {
            $retval .= $this->expandString($array[$i]);
        }

        return $retval;
    }
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);
    }
1286050
private static function objectToArray(array $array): array
    {
        foreach ($array as $key => &$value) {
            if (is_object($value) || is_array($value)) {
                $value = self::objectToArray((array) $value);
            }
        }

        return (array) $array;
    }
260471
public function flatter($array)
    {
        $result = [];
        foreach ($array as $item) {
            if (is_array($item)) {
                $result = array_merge($result, $this->flatter($item));
            } else {
                $result[] = $item;
            }
        }

        return $result;
    }
1269565
public static function cleanupArray($array)
    {
        $newArray = [];

        $array = static::toArray($array);

        foreach ($array as $key => $val) {

            if (is_array($val)) {
                $val = static::cleanupArray($val);
            } else {
                $val = trim($val);
                if (!$val) {
                    continue;
                }
            }

            $newArray[$key] = $val;
        }

        return $newArray;
    }
239692
private function getArrayValue(array $array)
    {
        $value = [];
        foreach ($array as $item) {
            if ($item instanceof Keyword) {
                $item = $this->getKeyword($item);
            }
            $value[] = trim(str_replace(array("\n", "\r"), '', strip_tags('' . $item)));
        }

        array_walk($value, function(&$item) { return trim(str_replace(array("\n", "\r"), '', strip_tags('' . $item))); });

        return implode(',', array_filter($value));
    }
1110967
public static function flatten($array = [])
    {
        $items = [];
        foreach ($array as $value) {
            if (is_array($value)) {
                $items = array_merge($items, self::flatten($value));
            } else {
                $items[] = $value;
            }
        }
        return $items;
    }
1078802
public static function getListFromArray(array $array) {
		$n=count($array);
		switch ($n) {
			case 0:
				return '';
			case 1:
				return $array[0];
			default:
				return implode(
						/* I18N: list separator */ I18N::translate(', '), 
						array_slice($array, 0, $n-1)
					) .
					/* I18N: last list separator, " and " in English, " et " in French  */ I18N::translate(' and ') . 
					$array[$n-1];
		}
	}