Re: fgets???
| From: | Daniel Brown | Date: | Fri, 08 Feb 2008 17:21:08 +0000 |
| Subject: | Re: fgets??? | ||
| References: | 1 2 3 4 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-268956@lists.php.net to get a copy of this message | ||
On Feb 8, 2008 12:19 PM, Zoltán Németh <znemeth@alterationx.hu> wrote:
> 2008. 02. 8, péntek keltezéssel 12.17-kor Daniel Brown ezt írta:
> > On Feb 8, 2008 12:11 PM, Pastor Steve <smarquez@ccfortsmith.com> wrote:
> > > I think I may have written the question wrong. I only want to display the
> > > first line. It is a news story with a headline. I only want to display the
> > > headline in the link.
> > >
> > > The output I want is:
> > >
> > > The
> > >
> > > But I am getting:
> > >
> > > The file looks like this.
> > >
> > > Does that make more sense?
> >
> > <?
> > $handle = fopen($filename);
> > $data = fgets($handle);
> > echo $data."\n";
> > ?>
> >
> > So long as you don't do a while() loop or something similar,
> > fgets() will only read the first line.
>
> sure, and much more efficient than my last letter, so ignore that...
> its friday, and late, and I'm still at work, so my mind is not on the
> top now... :)
Zoltan, if you're sticking around, zip me a message off-list. I
have a favor to ask of you.
--
</Dan>
Daniel P. Brown
Senior Unix Geek
<? while(1) { $me = $mind--; sleep(86400); } ?>