質問編集履歴

1

ソースコードの追記

2021/06/03 07:57

投稿

entaro12345
entaro12345

スコア75

test CHANGED
File without changes
test CHANGED
@@ -36,6 +36,50 @@
36
36
 
37
37
 
38
38
 
39
+
40
+
41
+ ↓↓ソースコードになります
42
+
43
+ ```PHP
44
+
45
+ <?php
46
+
47
+ ini_set('default_charset', 'UTF-8');
48
+
49
+
50
+
51
+ $csv = '';
52
+
53
+ $csv .= '現在時刻,時刻,差'."\r\n";
54
+
55
+
56
+
57
+ $csv .= '"15:00","15:30","00:30"'."\r\n";
58
+
59
+ $csv .= '"16:00","15:50","-00:10"'."\r\n";
60
+
61
+
62
+
63
+ // 出力
64
+
65
+ $travelNameFN = str_replace(' ','_',$travelName);
66
+
67
+ $fileName = $filename."_".mb_convert_encoding($travelNameFN, 'SJIS-win', 'UTF-8').".csv";
68
+
69
+ header('Content-Type: application/octet-stream');
70
+
71
+ header('Content-Disposition: attachment; filename='.$fileName);
72
+
73
+ echo pack('C*',0xEF,0xBB,0xBF).$csv;
74
+
75
+ exit();
76
+
77
+ ?>
78
+
79
+ ```
80
+
81
+
82
+
39
83
  ### 試したこと
40
84
 
41
85