0, "miners" => 0); } /** * Transfers all gold from the mine to the player's account. * * @return void */ function withdrawMine() { $amount = intval($_POST["amount"]); if($amount == 0) return; $_SESSION["mine"]["gold"] += $amount; echo json_encode($_SESSION["mine"]["gold"]); } /** * Returns the amount of gold currently owned by the player. * * @return int amount of gold available */ function sendMine() { if(empty($_SESSION["mine"])) initCraftMine(); $mine = $_SESSION["mine"]; return $mine["gold"]; } ?>