php生成txt文件
function totxt($str, $lottName){
if($str) {
$title = $lottName.'_'.date('YmdHi').'.txt';
header("Content-Type: application/force-download");
header("Content-Disposition:attachment;filename=".$title);
$str = str_replace('
', "\r\n", $str);
echo $str;
}
}
$betStr = $_POST['txt'];
$lottery = $_POST['lottery'];
$lottName = $_MGLOBAL['LOTTERY_NAME'][$lottery];
totxt($betStr, $lottName);