Re: string concatenation with fgets

From: Date: Wed, 25 Nov 2009 02:29:17 +0000
Subject: Re: string concatenation with fgets
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-300085@lists.php.net to get a copy of this message
On Nov 24, 2009, at 5:55 PM, Nirmalya Lahiri wrote:
--- On Wed, 11/25/09, aurfalien@gmail.com <aurfalien@gmail.com> wrote:
From: aurfalien@gmail.com <aurfalien@gmail.com> Subject: [PHP] string concatenation with fgets To: php-general@lists.php.net Date: Wednesday, November 25, 2009, 7:00 AM Hi all, I'm trying to append some text to what I read from a file. My code; $file = fopen("foo.txt", "r"); while (!feof($file)) {
    $line = fgets($file);
    print $line."sometext";
    }
fclose($file); foo,txt; a b c d e f g And when I run the script, it looks like; a sometextb sometextc sometextd ... Any ideas?
So, what output you actually wants from your program? Is it like this.... asometextbsometextcsometext...... or, like this.... asometext bsometext csometext
Hi, Sorry, I was incomplete :) I would like; asometext bsometext csometext Basically, I would like to add whatever text to the end of what I find in the file. So if the file contains a b c I would like; asometext bsometext csometext... - aurf

« previous php.general (#300085) next »