Re: file() and macintosh line break

From: Date: Wed, 01 May 2002 23:29:49 +0000
Subject: Re: file() and macintosh line break
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-95626@lists.php.net to get a copy of this message
Rodrigo Peres wrote:
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!
You can use split(). I think Mac linebreak is better to be recognized by PHP... -- Yasuo Ohgaki

« previous php.general (#95626) next »