I have a program which uploads ascii format files, parses the lines,and does some stuff. I can parse by breaking into array with explode(“n”,”fileContent”,) or doing the same with “r”, but i don’t konw how to test for all of the other line breaks, such as “0XOA”, ascii character 10, etc (see post from wiki below). anyone have experience with this ?
[SIZE=”2″]Systems based on ASCII or a compatible character set use either LF (Line feed, ‘n’, 0x0A, 10 in decimal) or CR (Carriage return, ‘r’, 0x0D, 13 in decimal) individually, or CR followed by LF (CR+LF, ‘rn’, 0x0D 0x0A). These characters are based on printer commands: The line feed indicated that one line of paper should feed out of the printer, and a carriage return indicated that the printer carriage should return to the beginning of the current line. Some rare systems, such as QNX before version 4, used the ASCII RS (record separator, 0x1E, 30 in decimal) character as the newline character.
LF: Multics, Unix and Unix-like systems (GNU/Linux, AIX, Xenix, Mac OS X, FreeBSD, etc.), BeOS, Amiga, RISC OS, and others. However, in tty ‘raw mode’, CR+LF is used for output and CR is used for input.
CR+LF: DEC TOPS-10, RT-11 and most other early non-Unix, non-IBM OSes, CP/M, MP/M, DOS (MS-DOS, PC-DOS, etc.), Atari TOS, OS/2, Microsoft Windows, Symbian OS, Palm OS
CR: Commodore 8-bit machines, TRS-80, Apple II family, Mac OS up to version 9 and OS-9
RS: QNX pre-POSIX implementation.