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 159969
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T10:57:08+00:00 2026-05-11T10:57:08+00:00

I wouldn’t know under what keyword to look for this in the PHP database,

  • 0

I wouldn’t know under what keyword to look for this in the PHP database, so I’m asking here.

Reason I want to know is because of how different Operating Systems handle new lines in textdocuments.

I’m using a CSV file in windows but each time I think I add a new line, what really happens is the new line gets pasted to the back of the latest line.

Reason is, in windows, a new line is this: \r\n And the CSVHandler.class.php file I’m using only adds \n

However, in MAC OS X that’s the new line, which is different from windows.

So I’m looking for this so I can implement a simple if() statement and solve this. Currently I’ve hardcoded the \r\n, but it should be simpler, no?

  • 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. 2026-05-11T10:57:08+00:00Added an answer on May 11, 2026 at 10:57 am

    PHP has included the constant PHP_EOL for solving the problem you face, available since php 4.3.10 and PHP 5.0.2 – it contains a suitable end-of-line sequence for the server that PHP is running on.

    If you want to use a different end-of-line sequence suitable for a particular client, then you’ll have to code that yourself. One way to determine the client OS is to use get_browser, assuming your server has an up-to-date browscap.ini

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

Sidebar

Related Questions

For some reason, after submitting a string like this Jack’s Spindle from a text
Wouldn't this be overkill and only one of these necessary? I've searched and found
I have a French site that I want to parse, but am running into
Wouldn't it be nice to just do a keystroke and have eclipse organize all
I have just tried to save a simple *.rtf file with some websites and
Is it possible to replace javascript w/ HTML if JavaScript is not enabled on
i got an object with contents of html markup in it, for example: string
I ran into a problem. Wrote the following code snippet: teksti = teksti.Trim() teksti
I have a JSP page retrieving data and when single or double quotes are
I used javascript for loading a picture on my website depending on which small

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.