php - fgetcsv() notice: "escape must be a single character" with 'µ'
519
When I usefgetcsv()
withescape
=µ
like this
$filename = 'test.csv';
$handle = fopen($filename, 'r');
$a = fgetcsv($handle, 0, ';', '"', 'µ');
php outputs a notice
Notice: fgetcsv() [function.fgetcsv]: escape must be a single character in myPhpFile.php on line 23
Why?
Answer
Solution:
µ isn't a standard Ascii character. Which means that PHP sees it as an UTF-8 encoded character which are 16 bits while Ascii is 8 bits. Hence the multiple characters. You should use something else.