print "Content-Disposition: attachment;filename=sample.csv\n";
とやるとOK。
以下サンプル
print "Content-type: text/x-hdml;charset=Shift_JIS\n"; print "Content-Disposition: attachment;filename=sample.csv\n"; print "\n"; for ($i=0; $i<=10; $i++) { for ($j=0; $j<=10; $j++) { $_ = ($i * $j); print "$_,"; } print "日本語だよ\n"; }
ネタ元