note 96622 deleted from function.fgets by thiago

From: Date: Mon, 08 Mar 2010 20:10:52 +0000
Subject: note 96622 deleted from function.fgets by thiago
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-166800@lists.php.net to get a copy of this message
Note Submitter: drkien ---- I try to join 3 lines from a text file using $Txt.=fgets($file)." ".fgets($file)." ".fgets($file)."\n " but it outputs them as 3 lines. Only after hours of pulling my hair out, i realize there is a linefeed at the start of each original line. So, this works: $Txt.=chop(fgets($file))." ".chop(fgets($file))." ".chop(fgets($file))."\n " Is there another more elegant way?

« previous php.notes (#166800) next »