Benjamin,
Use the file() function, it will read a file then return each line as
a new element in an array.
http://php.net/file
- Joe
On 7/23/06, Benjamin Adams [EMAIL PROTECTED] wrote:
how would I read a file one line at a time:
?php
if($lines $alllines){
$newline .= $lines;
}
?
Joe Wollard wrote:
Benjamin,
Use the file() function, it will read a file then return each line as
a new element in an array.
http://php.net/file
And if file is big (biiig) then you want
http://php.net/fgets
--
Sameer N. Ingole
http://weblogic.noroot.org/
---
Better to light one candle
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
Joe Wollard wrote:
Use the file() function, it will read a file then return each line as
a new element in an array.
http://php.net/file
This will not read the file one line at a time. Try http://php.net/fgets.
- -Stut
On 7/23/06, Benjamin Adams
Thanks, fgets works great didn't know the function before.
On Mon, 2006-07-24 at 01:56 +0530, Sameer N Ingole wrote:
Joe Wollard wrote:
Benjamin,
Use the file() function, it will read a file then return each line as
a new element in an array.
http://php.net/file
And if file is big
You could do it using the substring it you ALWAYS for each line want the characters at
that exact location.
$moo = 1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZ;
$partition = substr($moo, 9, 5);
this would return 5 characters from position 9 in the string which would be:
0ABCD
hope this helps...
5 matches
Mail list logo