Computes the output for the given data array

@param array $array
@param string $prefixLine
@return string
510947
protected function renderDataTable($array, $prefixLine = "")
    {
        $columnsHaveInvalidChars = $this->areTableLabelsInvalidXmlTagNames(reset($array));

        $out = '';
        foreach ($array as $rowId => $row) {
            if (!is_array($row)) {
                $value = self::formatValueXml($row);
                if (strlen($value) == 0) {
                    $out .= $prefixLine . "\t\t<$rowId />\n";
                } else {
                    $out .= $prefixLine . "\t\t<$rowId>" . $value . "</$rowId>\n";
                }
                continue;
            }

            // Handing case idgoal=7, creating a new array for that one
            $rowAttribute = '';
            if (strstr($rowId, '=') !== false) {
                $rowAttribute = explode('=', $rowId);
                $rowAttribute = " " . $rowAttribute[0] . "='" . $rowAttribute[1] . "'";
            }
            $out .= $prefixLine . "\t<row$rowAttribute>";

            if (count($row) === 1
                && key($row) === 0
            ) {
                $value = self::formatValueXml(current($row));
                $out .= $prefixLine . $value;
            } else {
                $out .= "\n";
                foreach ($row as $name => $value) {
                    // handle the recursive dataTable case by XML outputting the recursive table
                    if (is_array($value)) {
                        if (is_array(reset($value))) {
                            $value = "\n" . $this->renderDataTable($value, $prefixLine . "\t\t");
                        } else {
                            $value = "\n" . $this->renderArray($value, $prefixLine . "\t\t");
                        }
                        $value .= $prefixLine . "\t\t";
                    } else {
                        $value = self::formatValueXml($value);
                    }

                    list($tagStart, $tagEnd) = $this->getTagStartAndEndFor($name, $columnsHaveInvalidChars);

                    if (strlen($value) == 0) {
                        $out .= $prefixLine . "\t\t<$tagStart />\n";
                    } else {
                        $out .= $prefixLine . "\t\t<$tagStart>" . $value . "</$tagEnd>\n";
                    }
                }
                $out .= "\t";
            }
            $out .= $prefixLine . "</row>\n";
        }
        return $out;
    }
1190375
function extract($arr,$prefix) {
		$out=[];
		foreach (preg_grep('/^'.preg_quote($prefix,'/').'/',array_keys($arr))
			as $key)
			$out[substr($key,strlen($prefix))]=$arr[$key];
		return $out;
	}
624441
public static function formatArray(array $array, $braces = true)
    {
        $isMultiline = self::isArrayMultiline($array);

        $array = self::prepareArrayLines($array);

        $eol = $isMultiline ? PHP_EOL : '';

        $output = implode($array, ', ' . $eol);

        if ($isMultiline) {
            // apply base indent to array elements
            $output = self::indentLines($output, self::$tabSize);
        }

        if ($braces) {
            $output = implode(['[', $output, ']'], $eol);
        } else {
            $output = $eol . $output . $eol;
        }

        return $output;
    }
865763
public static function parseArrayToPg($array)
	{
		foreach ($array as $key => $value) {
			if (is_array($value)) {
				$array[$key] = self::parseArrayToPg($value);
			}
		}

		return '{' . implode(',', $array) . '}';
	}
1304505
public static function filter_prefixed($array, $prefix, $removePrefix = true)
    {
        $return =[];
        foreach ($array as $key => $val) {
            if (preg_match('/^'.$prefix.'/', $key)) {
                if ($removePrefix === true) {
                    $key = preg_replace('/^'.$prefix.'/','',$key);
                }
                $return[$key] = $val;
            }
        }
        return $return;
    }
696216
public function copyToArray(array &$array)
    {
        $array['start']      = $this->start;
        $array['end']        = $this->end;
        $array['developer']  = $this->developer;
        $array['totalCount'] = $this->totalCount;
        $array['clients']    = LanguageUtility::convertArrayOfArrayCopyableToArray($this->clients);
    }
185458
protected function arrayDot($array, $prepend = '')
    {
        $results = array();

        foreach ($array as $key => $value) {
            if (is_array($value)) {
                $results = array_merge($results, $this->arrayDot($value, $prepend.$key.'.'));
            } else {
                $results[$prepend.$key] = $value;
            }
        }

        return $results;
    }
1310553
public static function prefixArray(array $array, $prefix, $separator = '_')
    {
        return array_combine(
            array_map(
                function ($key) use ($prefix, $separator) {
                    return $prefix . $separator . $key;
                },
                array_keys($array)
            ),
            $array
        );
    }
364575
protected static function encodeArray($array)
    {
        if (Arrays::isAssoc($array)) {
            $output = [];
            foreach ($array as $key => $val) {
                $output[] = $key . ':' . \addcslashes($val, ': ');
            }

            return self::encodeString(\implode(' ', $output));
        }

        $output = [];
        foreach ($array as $val) {
            $output[] = \addcslashes($val, ': ');
        }

        return self::encodeString(\implode(' ', $output));
    }
738681
private function tableBody(array $dependencyArray)
    {
        $output = '<tbody>';
        $numIndex = 1;
        foreach ($dependencyArray as $dependencyRow => $dependencies) {
            $output .= "<tr><th>$numIndex: $dependencyRow</th>";
            foreach ($dependencies as $dependencyHeader => $count) {
                if ($dependencyRow === $dependencyHeader) {
                    $output .= '<td>X</td>';
                } else {
                    $output .= '<td>' . $count . '</td>';
                }
            }
            $output .= '</tr>';
            $numIndex += 1;
        }
        $output .= '</tbody>';
        return $output;
    }
73328
private function yamlizeArray($array, $indent)
    {
        if (is_array($array)) {
            $string = '';
            $previous_key = -1;

            foreach ($array as $key => $value) {
                if (!isset($first_key)) {
                    $first_key = $key;
                }

                $string .= $this->yamlize($key, $value, $indent, $previous_key, $first_key, $array);
                $previous_key = $key;
            }

            return $string;
        } else {
            return false;
        }
    }
1115205
public static function loadArray(array $array,$prefix_path=null){
    $array = static::filterWith(["load.array", "load"], $array);
    if ($prefix_path){
      static::set($prefix_path,$array);
    } else {
      static::merge($array);
    }
    self::trigger('loaded');
  }
959471
public static function dot(array $array, string $prepend = ''): array
    {
        $cache = serialize(['array' => $array, 'prepend' => $prepend]);

        if (array_key_exists($cache, self::$dotted)) {
            return self::$dotted[$cache];
        }

        $results = [];

        foreach ($array as $key => $value) {
            if (is_array($value)) {
                $results = array_merge($results, static::dot($value, $prepend . $key . '.'));
            } else {
                $results[$prepend . $key] = $value;
            }
        }

        return self::$dotted[$cache] = $results;
    }
255252
private function output_array($headers, $array) {
		$data[0] = $headers;
		$data = array_merge($data, $array);
		$spreadsheet = new \PhpOffice\PhpSpreadsheet\Spreadsheet();
		$sheet = $spreadsheet->getActiveSheet(1);
		$sheet->fromArray($data);

		$objWriter = new \PhpOffice\PhpSpreadsheet\Writer\Xlsx($spreadsheet);
		ob_start();
		$objWriter->save("php://output");
		$content = ob_get_clean();

		$file = \File::store($this->pager->get_classname() . '.xlsx', $content);
		$file->expire();

		$file->client_download();
	}
248986
public function prefixArrayKeys($prefix, $array)
    {
        return array_combine(array_map(function ($key) use ($prefix) {
            return $prefix.$key;
        }, array_keys($array)), array_values($array));
    }
984339
private function prefixWithHelperName($array, $prefix = true)
    {
        if ($prefix) {
            $newArray = [];
            foreach ($array as $key => $value) {
                $newArray['date.'.$key] = $value;
            }
            $array = $newArray;
        }

        return $array;
    }
1236638
public static function flattenArray(array $array, $prefix = '')
    {
        $result = [];

        foreach ($array as $key => $value) {
            if (is_array($value)) {
                $result = $result + self::flattenArray($value, $prefix.$key.'.');
            } else {
                $result[$prefix.$key] = self::normalizeValue($value);
            }
        }

        return $result;
    }