Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8732685
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T09:28:54+00:00 2026-06-13T09:28:54+00:00

I built an app that takes in a CSV as a bulk feed and

  • 0

I built an app that takes in a CSV as a bulk feed and I’ve notice a difference in CSVs when it is saved as a “Windows Comma Separated” vs. “Comma Separated” when saving in Excel on Mac. My script can only parse the Windows version and I can’t see how to overcome this in my code.

I found out that they’re different in the lines returns: http://cl.ly/image/3x463O3b0A1s

Here is the filetype list in Mac Excel: http://cl.ly/image/2F110Q1X0V0i

I explode it into lines like so:

$lines = explode("\n", $content);

With the regular CSV, it doesn’t recognize any lines, but with the Windows version it works as expected (go figure!). How do I fix this?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T09:28:55+00:00Added an answer on June 13, 2026 at 9:28 am

    As mentioned before, you should use fgetcsv() … However, I still had problems with CSVs generated on Macs using that function.

    PHP was not properly detecting line endings. To overcome the issue, I had to add ini_set("auto_detect_line_endings", true); to the function that was processing the CSV file.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have built an app that works only when not run as a Windows
I've built an app that sends an JSON array via POST on a HTTP
I have built an app that stores dates entered by the user in an
I have built an app that plays lots of sounds the easy way: AudioServicesPlaySystemSound(someSoundID);
I have an iPhone app that I've built for the app store. Before I
I built my qt app so that all the Qt modules it uses are
I have an app that uses the built-in flip animation to switch between the
I have an iphone app that I built based off a tutorial (for a
I've built a C# .NET app that uses the Adobe ActiveX control to display
I'm trying to work with an app that's been built in Grails, but I'm

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.