CSV new Line Character

前端 未结 1 948
花落未央
花落未央 2021-01-06 11:44

I have an Excel Template that i use to fill in data and export that to CSV to populate the following page on my website.

http://play.mink7.com/ifocus_v4/careers.php<

相关标签:
1条回答
  • 2021-01-06 12:30

    PHPs file functions do not reliably recognize line endings from Macs (if they use \r character, as Mac Excel does, if I recall correctly.)

    You need to set auto_detect_line_endings in php.ini to true, then it will properly recognize line endings, whether they are \n, \r, or \r\n.

    This setting is PHP_INI_ALL, which means that it can be set anywhere, i.e., in php.ini, in .htaccess for a particular directory, or even with ini_set, e.g., ini_set('auto_detect_line_endings', true)

    0 讨论(0)
提交回复
热议问题