RE: [PHP] file() and macintosh line break

From: Date: Wed, 01 May 2002 14:57:03 +0000
Subject: RE: [PHP] file() and macintosh line break
Groups: php.general 
Request: Send a blank email to php-general+get-95528@lists.php.net to get a copy of this message
Good day, Calm down, the excessive !'s are a bit unnecessary. One possible solution is to read the entire thing into one string, and then use the split or preg_split function on the \r against it. This will give you an array with one line per entry. ============================ Darren Gamble Planner, Regional Services Shaw Cablesystems GP 630 - 3rd Avenue SW Calgary, Alberta, Canada T2P 4L4 (403) 781-4948 > -----Original Message----- > From: Rodrigo Peres [mailto:rperes@mac.com] > Sent: Wednesday, May 01, 2002 8:55 AM > To: php-general@lists.php.net > Subject: [PHP] file() and macintosh line break > > > Hi list, > > I'm in a problem that is driving me crazy!!! I want open a > file and puts > each line into an array, but this files was created in macintosh!! so > the file() can't recognize the end line and only outputs 1 element in > array!! How can I solve it. I tried to fread() the file and > eregi_replace the line breaks, it worked, but now I don't know how to > use this to create the array! > > Thank's in advance > > Rodrigo > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php >

« previous php.general (#95528) next »