Re: Re: get line from file
| From: | Jason Wong | Date: | Fri, 19 Jul 2002 07:45:53 +0000 |
| Subject: | Re: Re: get line from file | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-108460@lists.php.net to get a copy of this message | ||
On Friday 19 July 2002 15:43, Peter wrote:
> You can try this.
>
> <?PHP
>
> $datafile = file("..."); // Here comes your filename
>
> for ($k=0; $k<=count($datafile)-1; $k++) {
>
> echo "$datafile[$k]<br>"; // Display each line read from datafile
>
> }
>
> ?>
foreach ($datafile as $line) {
echo "$line<br>";
}
is a lot simpler and easier to understand.
--
Jason Wong -> Gremlins Associates -> www.gremlins.com.hk
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *
/*
I stick my neck out for nobody.
-- Humphrey Bogart, "Casablanca"
*/