Re: HELP! printing Arrays
| From: | Brian V Bonini | Date: | Thu, 04 Mar 2004 00:17:30 +0000 |
| Subject: | Re: HELP! printing Arrays | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-179392@lists.php.net to get a copy of this message | ||
On Wed, 2004-03-03 at 18:30, Labunski wrote:
> Hello,
>
> // This will print first and sixth line from the text file:
> $file = file("people.txt");
> print "$file[0]<br>";
> print "$file[6]<br>";
>
> // But how to print all the lines from [0] to [6] ?
> // Hope you understood my problem.
>
for($i=0; $i < 6; $i++) {
echo "$file[$i]<br />\n";
}
--
Brian V Bonini <b-bonini@cox.net>