line endingg
Moderator: General Moderators
-
magicrobotmonkey
- Forum Regular
- Posts: 888
- Joined: Sun Mar 21, 2004 1:09 pm
- Location: Cambridge, MA
line endingg
The specs for a project I'm working on require that I take new-line delimited information from a text box and put it into an array. I am having trouble trying to figure the best way to do this so that I can take input from macs, windows boxes, or linux boxes. Right now I just explode on "\r\n\" and that works fine, but I know its not going to work for a mac or for a linux machine. Has anyone run into this problem before? I am just trying to figure out a couple of str_replaces or something in the right order which will ensure that I get similar output from \r\n, \r, or \n.
- feyd
- Neighborhood Spidermoddy
- Posts: 31559
- Joined: Mon Mar 29, 2004 3:24 pm
- Location: Bothell, Washington, USA
Code: Select all
$arr = preg_split('#ї\r\n]+#', $yourText);