Skip to content

Instantly share code, notes, and snippets.

@islahul
Last active August 29, 2015 14:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save islahul/3841386348a28979ccb7 to your computer and use it in GitHub Desktop.
Save islahul/3841386348a28979ccb7 to your computer and use it in GitHub Desktop.
PHP: fgetcsv function, CSV upload/read failing to detect line endings on Mac
<?php
// Solution: http://php.net/manual/en/filesystem.configuration.php#ini.auto-detect-line-endings
ini_set("auto_detect_line_endings", true);
// In a Wordpress plugin
@ini_set("auto_detect_line_endings", true);
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment