What would be the best way to detect newline return method in PHP. CR, LF or CR+LF
And if possible convert it to specified type.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
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.
Checks what kind of newline is in the string. 0 is returned when no newline is found.
To normalize/standardize all newlines use the following function:
Hope it helps!