Board logo

标题: php生成txt文件 [打印本页]

作者: fangzhen    时间: 2009-11-8 00:22     标题: 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);




欢迎光临 PHP开发笔记 (http://phpvi.com/) Powered by Discuz! 6.1.0