Re: [PHP] reading from files
On Saturday 18 September 2004 04:58, Steve Brown wrote: > > I am wondering how to read lines from a file to a php array? I would like > > to integrate a logfile into a html site. Is it possible to read line by > > line and to check how many lines there are in total? > > I'm new here, so someone please tell me if "RTFM" is frowned upon as a > response. :) Yes. From manual > Filesystem Functions > Table of Contents (ie list of functions), it's pretty obvious: file -- Reads entire file into an array that the OP never even bothered to try finding out the answer before asking the list. > http://www.php.net/fgets Sorry, close, but no cigar. -- Jason Wong -> Gremlins Associates -> www.gremlins.biz Open Source Software Systems Integrators * Web Design & Hosting * Internet & Intranet Applications Development * -- Search the list archives before you post http://marc.theaimsgroup.com/?l=php-general -- /* "No, no, I don't mind being called the smartest man in the world. I just wish it wasn't this one." -- Adrian Veidt/Ozymandias, WATCHMEN */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] reading from files
On Fri, 17 Sep 2004 15:58:04 -0500, Steve Brown <[EMAIL PROTECTED]> wrote: > I'm new here, so someone please tell me if "RTFM" is frowned upon as a > response. :) RTFA and find out :) -- Greg Donald http://gdconsultants.com/ http://destiney.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] reading from files
[snip] I'm new here, so someone please tell me if "RTFM" is frowned upon as a response. :) [/snip] Yes. Becasue you have forgotten the also important STFA and STFW. All or nothingall or nothing. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] reading from files
I usually use file(): http://www.php.net/manual/en/function.file.php -TG > -Original Message- > From: Merlin [mailto:[EMAIL PROTECTED] > Sent: Friday, September 17, 2004 4:17 PM > To: [EMAIL PROTECTED] > Subject: [PHP] reading from files > > > Hi there, > > I am wondering how to read lines from a file to a php array? > I would like to > integrate a logfile into a html site. Is it possible to read > line by line and to > check how many lines there are in total? > > Thank you for any hint on that, > > Merlin > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] reading from files
From: "Merlin" <[EMAIL PROTECTED]> I am wondering how to read lines from a file to a php array? I would like to integrate a logfile into a html site. Is it possible to read line by line and to check how many lines there are in total? Thank you for any hint on that, Hint: http://www.php.net/manual/en/ref.filesystem.php ---John Holmes... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] reading from files
[snip] I am wondering how to read lines from a file to a php array? I would like to integrate a logfile into a html site. Is it possible to read line by line and to check how many lines there are in total? [/snip] Start with http://www.php.net/fopen -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] reading from files
> I am wondering how to read lines from a file to a php array? I would like to > integrate a logfile into a html site. Is it possible to read line by line and to > check how many lines there are in total? I'm new here, so someone please tell me if "RTFM" is frowned upon as a response. :) http://www.php.net/fgets -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] reading from files
On Fri, 17 Sep 2004 22:16:43 +0200, Merlin <[EMAIL PROTECTED]> wrote: > I am wondering how to read lines from a file to a php array? I would like to > integrate a logfile into a html site. Is it possible to read line by line and to > check how many lines there are in total? > > Thank you for any hint on that, http://php.net/fread http://php.net/fwrite -- Greg Donald http://gdconsultants.com/ http://destiney.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] reading from files
use the functoin file, it does exactly that. http://ca3.php.net/manual/en/function.file.php Jason Merlin <[EMAIL PROTECTED]> wrote: > > Hi there, > > I am wondering how to read lines from a file to a php array? I would like to > integrate a logfile into a html site. Is it possible to read line by line and to > > check how many lines there are in total? > > Thank you for any hint on that, > > Merlin > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] reading from files
--- Merlin <[EMAIL PROTECTED]> wrote: > Hi there, > > I am wondering how to read lines from a file to a php array? I > would like to > integrate a logfile into a html site. Is it possible to read line > by line and to > check how many lines there are in total? http://www.php.net/file > > Thank you for any hint on that, > > Merlin > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > = Mark Weinstock [EMAIL PROTECTED] *** You can't demand something as a "right" unless you are willing to fight to death to defend everyone else's right to the same thing. *** __ Do you Yahoo!? New and Improved Yahoo! Mail - Send 10MB messages! http://promotions.yahoo.com/new_mail -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] reading from files
[snip] I am wondering how to read lines from a file to a php array? I would like to integrate a logfile into a html site. Is it possible to read line by line and to check how many lines there are in total? Thank you for any hint on that, [/snip] http://www.php.net/fgets is a good starting point. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] reading from files
Hi there, I am wondering how to read lines from a file to a php array? I would like to integrate a logfile into a html site. Is it possible to read line by line and to check how many lines there are in total? Thank you for any hint on that, Merlin -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php