\n"; foreach ($columns as $round) { $out .= " \n"; } return $out . " \n"; } /** * One half of the bracket, from the seeds inward ($side 'left') or from the * Elite Eight outward ($side 'right'). */ function half_bracket(array $top, array $bottom, string $side): string { $order = $side === 'left' ? [0, 1, 2, 3, 4] : [4, 3, 2, 1, 0]; $out = "
\n"; foreach ($order as $n) { $entries = array_merge($top['rounds'][$n], $bottom['rounds'][$n]); if ($n === 0) { $out .= " \n"; continue; } // The Sweet 16 column labels each region in the spacer between its pair. $labels = $n === 3 ? [$top['label'], $bottom['label']] : []; $out .= " \n"; } return $out . "
\n"; } $leftHeads = [$rounds[0], $rounds[1], $rounds[2], $rounds[3], $rounds[4]]; $rightHeads = array_reverse($leftHeads); ?> Jeff's Random Bracket Generator - <?= e((string) $data['year']) ?>

Generate a random bracket for the men's basketball tournament. Refresh to generate a new random bracket. Prints better in landscape. PHP by @jefftml. Layout by Kristen Nielsen.