Skip to content

Instantly share code, notes, and snippets.

@blackswansolutions
blackswansolutions / bracket.php
Created August 9, 2012 17:31 — forked from LaffinToo/bracket.php
PHP: Tourney Bracket System
<?php
$teams=array('Alpha','Beta','Gamma','Delta','Epsilon','Zeta','Eta');
define('MY_EOL','<br .>'.PHP_EOL);
$round=0;
$participants=$teams;
while(count($participants)>1)
{
$round++; // Increment our round
@blackswansolutions
blackswansolutions / bytesize.php
Created August 9, 2012 17:32 — forked from LaffinToo/bytesize.php
PHP: Tracker - Returns units based on bytes
function ByteSize($size)
{
static $unit = array('B', 'kB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB');
$size/=(pow(1024,($idx=floor(log($size)/log(1024)))));
return number_format($size,2).$unit[$idx];
}