Skip to content

Commit 898627b

Browse files
authored
Fix: Add explicit $escape parameter in fputcsv for PHP 8.4 compatibility (#4283)
This commit resolves a deprecation warning in PHP 8.4 regarding the $escape parameter of the fputcsv function. The warning indicates that the default value for $escape will change in future PHP versions, requiring it to be explicitly provided.
1 parent 810229e commit 898627b

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

reference/filesystem/functions/fputcsv.xml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -127,16 +127,16 @@
127127
<![CDATA[
128128
<?php
129129
130-
$list = array (
131-
array('aaa', 'bbb', 'ccc', 'dddd'),
132-
array('123', '456', '789'),
133-
array('"aaa"', '"bbb"')
134-
);
130+
$list = [
131+
['aaa', 'bbb', 'ccc', 'dddd'],
132+
['123', '456', '789'],
133+
['"aaa"', '"bbb"']
134+
];
135135
136136
$fp = fopen('file.csv', 'w');
137137
138138
foreach ($list as $fields) {
139-
fputcsv($fp, $fields);
139+
fputcsv($fp, $fields, ',', '"', '');
140140
}
141141
142142
fclose($fp);

0 commit comments

Comments
 (0)