PMA\setup\lib\ConfigGenerator::_exportZeroBasedArray PHP Метод

_exportZeroBasedArray() приватный статический Метод

Exports continuous 0-based array
private static _exportZeroBasedArray ( array $array, string $crlf ) : string
$array array Array to export
$crlf string Newline string
Результат string
    private static function _exportZeroBasedArray(array $array, $crlf)
    {
        $retv = array();
        foreach ($array as $v) {
            $retv[] = var_export($v, true);
        }
        $ret = "array(";
        if (count($retv) <= 4) {
            // up to 4 values - one line
            $ret .= implode(', ', $retv);
        } else {
            // more than 4 values - value per line
            $imax = count($retv);
            for ($i = 0; $i < $imax; $i++) {
                $ret .= ($i > 0 ? ',' : '') . $crlf . '    ' . $retv[$i];
            }
        }
        $ret .= ')';
        return $ret;
    }