When you output csv by fputcsv, if there are any Chinese character, you may get messy code. Then you need to set the encoding properly:
fprintf($fp, chr(0xEF).chr(0xBB).chr(0xBF)); // just add this line
fputcsv($fp, ...);
When you output csv by fputcsv, if there are any Chinese character, you may get messy code. Then you need to set the encoding properly:
fprintf($fp, chr(0xEF).chr(0xBB).chr(0xBF)); // just add this line
fputcsv($fp, ...);