Re: Re: get line from file
| From: | Michael Hall | Date: | Fri, 19 Jul 2002 17:55:05 +0000 |
| Subject: | Re: Re: get line from file | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-108459@lists.php.net to get a copy of this message | ||
I think more info is probably needed here. Is it always the literal string
"line3" that you want to catch, or always the second last line?
Some kind of regular expression solution is probably what you need.
Michael
On Fri, 19 Jul 2002, 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
>
> }
>
> ?>
>
>
> "Yamin Prabudy" <phplist@pro.net.id> schreef in bericht
> news:200207191258.05136.phplist@pro.net.id...
> > I got a file line like this
> >
> > <!-- START -->
> > This is a line1
> > this is a line2
> > this is a line3
> > this is a line4
> > <!-- END -->
> >
> >
> >
> > how can i grep out the line1,line2,line3 ??
> > do anyone out there have any idea ?
> >
>
>
>
>
--
--------------------------------
n i n t i . c o m
php-python-perl-mysql-postgresql
--------------------------------
Michael Hall ninti@ninti.com
--------------------------------