PHP

Moderators: None (Apply to moderate this forum)
Number of threads: 1848
Number of posts: 5016

This Forum Only
Post New Thread
Single Post View       Linear View       Threaded View      f

Report
trying to find out how to read a file in php..(fopen etc) Posted by GoodGrendel on 3 Nov 2001 at 8:13 AM
hi, i'm sorta a newbee to PHP.

anyway, i have looked the net for a few minutes but i couldnt find something that solved my problem.

i'm trying to make a script wich reads lines of a file.

so far i tried the readf thingy, but someone told me you could use an array in order to get some specefic lines e.g $filename[0] would give the first line, though i couldnt find anything about that.

I would be verry happy if someone could push me a bit in the right direction, or give me a little example on how to do this.

Regards,
Ivo Jonker

Report
Re: trying to find out how to read a file in php..(fopen etc) Posted by iDaZe on 4 Nov 2001 at 12:21 PM
: hi, i'm sorta a newbee to PHP.
:
: anyway, i have looked the net for a few minutes but i couldnt find something that solved my problem.
:
: i'm trying to make a script wich reads lines of a file.
:
: so far i tried the readf thingy, but someone told me you could use an array in order to get some specefic lines e.g $filename[0] would give the first line, though i couldnt find anything about that.
:
: I would be verry happy if someone could push me a bit in the right direction, or give me a little example on how to do this.
:
: Regards,
: Ivo Jonker
:

$myfile = file( $yourfilename );
$i = 0;
while ($i < length($myfile)) {
  $currentline = $myfile[$i];
  $i++;
}


you get tge idea




 

Recent Jobs

Official Programmer's Heaven Blogs
Web Hosting | Browser and Social Games | Gadgets

Popular resources on Programmersheaven.com
Assembly | Basic | C | C# | C++ | Delphi | Flash | Java | JavaScript | Pascal | Perl | PHP | Python | Ruby | Visual Basic
© Copyright 2011 Programmersheaven.com - All rights reserved.
Reproduction in whole or in part, in any form or medium without express written permission is prohibited.
Violators of this policy may be subject to legal action. Please read our Terms Of Use and Privacy Statement for more information.
Operated by CommunityHeaven, a BootstrapLabs company.