Re: Odd file() behaviour

From: Date: Mon, 08 Jan 2001 06:03:48 +0000
Subject: Re: Odd file() behaviour
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-33190@lists.php.net to get a copy of this message
Does the file have Unix newlines, PC newlines, or Mac newlines?... Look at it in "vi". If you see a bunch of ^Ms, or if the down arrow button only shows you one or two lines, you know it ain't Unix newlines. Various editors on PC/Mac can "Save As..." Unix file format. Use one. I recommend BBEdit (Mac) and EditPlus (PC). These are religious choices, however, and you are welcome to consult your own oracles for advice. There's a PHP-Editor page out there that lists all your choices somewhere that's been posted to the list a few thousand times... ----- Original Message ----- From: "Patrick Dunford" <pdunford.webs@clear.net.nz> Newsgroups: php.general Sent: Saturday, January 06, 2001 5:22 AM Subject: [PHP] Odd file() behaviour > I have a text file on my server consisting of 26 lines of text. When I call > file(), passing it the filename, it returns saying the file has two lines, > both of which are blank. If I call readfile() it outputs to the screen the > entire file, as expected, except that it is all on one line. > > Why is file() failing? > > ======================================================================= > Patrick Dunford, Christchurch, NZ - > http://pdunford.godzone.net.nz/ > > I will sing to the LORD all my life; I will sing praise to my > God as long as I live. May my meditation be pleasing to him, as I > rejoice in the LORD. > -- Psalm 104:33-34 > http://www.heartlight.org/cgi-shl/todaysverse.cgi?day=20010106 > ======================================================================= > Created by Mail2Sig - > http://pdunford.godzone.net.nz/software/mail2sig/ > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net > For additional commands, e-mail: php-general-help@lists.php.net > To contact the list administrators, e-mail: php-list-admin@lists.php.net >

« previous php.general (#33190) next »