Home > Article > Backend Development > Usage of fgetcsv and compatibility issues between windows and linux
CSV file: George, John, Thomas, USA James, Adrew, Martin, USA The output is similar to: Array ( [0] => George [1] => John [2] => Thomas [3] => USA ) Example 2:
CSV file: George, John, Thomas, USA James, Adrew, Martin, USA The output is similar to: Array ( [0] => George [1] => John [2] => Thomas [3] => USA Array ( [0] => James [1] => Adrew [2] => Martin [3] = > USA ) Attachment: Compatibility issues between windows and linux When the empty data processed by fgetcsv under the Linux platform was generated, I initially thought it was a problem with the PHP version, but it actually had nothing to do with the version. Colleagues who develop under Windows have no problem, but colleagues on their own laptops, servers, and Linux systems all have problems with empty data. Solution: Setting area: Simplified Chinese, UTF-8 encoding setlocale(LC_ALL, 'zh_CN.UTF-8'); |