public function createLeague() { $postedData = file_get_contents("php://input"); $postedData = substr($postedData, 2, -2); $isValidToken = User::checkAuth(); if ($isValidToken != 0) { $leagueName = explode(':', $postedData)[1]; return League::createLeaguebyName($leagueName); } else { return json_encode("Please enter valid Authentication Token"); } }
public function createleague() { $league_name = $_GET['league_name']; League::createLeaguebyName($league_name); return 1; }