Re: Can php read and than print file like it is

From: Date: Mon, 02 Apr 2001 16:56:33 +0000
Subject: Re: Can php read and than print file like it is
References: 1 2 3  Groups: php.general 
Request: Send a blank email to php-general+get-46647@lists.php.net to get a copy of this message
"Jan Grafström" <jan@lillemanshus.com> wrote: > Thank You Steve! > Here is my php > ---- > <? > $fillista = "fillista.xml"; > $fp = @fopen($fillista,r); > $count = fgets($fp,filesize($fillista)); > fclose($fp); > print "fillista=".$count; > ?> Your call to fgets() is only returning the first line of the input file. Add the following line after it and $count will now have the first 2 lines: $count .= fgets($fp,filesize($fillista)); If you construct your code to *loop* through the input file using fgets() like the first example at http://www.php.net/manual/en/function.fgets.php that I mentioned your problem will be solved. Good luck! -- Steve Werby President, Befriend Internet Services LLC http://www.befriend.com/

« previous php.general (#46647) next »