Okay. So far I've figured a way to determine the number of rounds required to complete a tournament with x number of players. However, x has to be a number that will come out evenly when thrown into the formula n = log10(x) / log10(2); If it doesn't come out evenly, we know we have an odd number of brackets to generate, and things won't line up.
However, does anyone have an idea on how we can calculate how many bye's we would we need based on the odd number of players? If you guys have any insight on this let me know. Here is my round calculater so far.
$rounds = (log10($teams) / log10(2));
if( count(explode('.',$rounds)) > 0 ) { print("Invalid number of teams."); }