You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
<?phpfputcsv($fh, ['Jan', 'He said "Hello"', "Line1\nLine2"], ';', '"', '"');
Resulted in this output:
Jan;"He said "Hello"";"Line1
Line2"
But I expected this output instead:
"Jan";"He said ""Hello""";"Line1
In the expected output it should be the quote chars doubled and whole second cell should be by quote chars enclosed. Expected output will be then properly read by Excel (we use Czech, so semicolon used as col separator)
PHP Version
PHP Version 8.4.6
Windows NT ___ 10.0 build 22631 (Windows 11) AMD64
Operating System
Windows
The text was updated successfully, but these errors were encountered:
Warning
When escape is set to anything other than an empty string ("") it can result in CSV that is not compliant with » RFC 4180 or unable to survive a roundtrip through the PHP CSV functions. The default for escape is "\" so it is recommended to set it to the empty string explicitly. The default value will change in a future version of PHP, no earlier than PHP 9.0.
Description
The following code:
Resulted in this output:
But I expected this output instead:
In the expected output it should be the quote chars doubled and whole second cell should be by quote chars enclosed. Expected output will be then properly read by Excel (we use Czech, so semicolon used as col separator)
PHP Version
PHP Version 8.4.6
Windows NT ___ 10.0 build 22631 (Windows 11) AMD64
Operating System
Windows
The text was updated successfully, but these errors were encountered: