require_once($_SERVER['DOCUMENT_ROOT'] . "/objects/common.php"); $gid = 20252; $file_path = $_SERVER['DOCUMENT_ROOT'] . "/$gid/"; // Build Results // Open File and Start the Parse Job. $parse_file = $file_path . "_results.txt"; $handle = @fopen($parse_file, "r"); $replace = array(" ", "'"); if ($handle) { while (!feof($handle)) { $line++; $content = fgetcsv($handle, 4096); // list($date,$away,$away_score,$home,$home_score) = explode(",", $content); $date = trim($content[0]); $winnings = trim($content[1]); $away = trim($content[2]); $away_score = trim($content[3]); $home = trim($content[4]); $home_score = trim($content[5]); $away_final = substr($away_score, -1); $home_final = substr($home_score, -1); if (strpos($away, 'Reverse') !== false) { if ($home_score < $away_score){ $home = "$home"; $home_score = "$home_score"; $winner = "$home_final-$away_final"; $find_winner = $home_final . $away_final; } else if ($home_score > $away_score){ $away = "$away"; $away_score = "$away_score"; $winner = "$away_final-$home_final"; $find_winner = $away_final . $home_final; } } else { if ($home_score > $away_score){ $home = "$home"; $home_score = "$home_score"; $winner = "$home_final-$away_final"; $find_winner = $home_final . $away_final; } else if ($home_score < $away_score){ $away = "$away"; $away_score = "$away_score"; $winner = "$away_final-$home_final"; $find_winner = $away_final . $home_final; } } // if ($find_winner){ // $winning_person = $winners_array[$find_winner]; // Find person and then add their values to totals array // $find_person = array_search($winning_person,$people); // $totals[$find_person] = $totals[$find_person] + $winnings; $winningscore[$find_winner] = $winningscore[$find_winner] + $winnings; } $results .= ("
With 68 chances to win, this is easily the best format to enjoy March Madness and pocket some cash!
If Syracuse beats Villanova 77-75:
Total of 68 games played: