Re: [PHP] Printing line x in a file

2002-05-12 Thread Austin Gonyou
On Sun, 2002-05-12 at 00:10, Miguel Cruz wrote: On Sat, 11 May 2002, Andrew Conner wrote: I have a script where I need to get the text from line number $line in file $filename then save it to a var ($text) and then print it. For example, in the file lamb.txt (just an example file):

Re: [PHP] Printing line x in a file

2002-05-12 Thread Thalis A. Kalfigopoulos
If the file is relatively small, then the easiest would be to use file() which reads a file into an array $file_array=file($filename); $text=$file_array[$line]; cheers, thalis On Sat, 11 May 2002, Andrew Conner wrote: I have a script where I need to get the text from line number $line in

[PHP] Printing line x in a file

2002-05-11 Thread Andrew Conner
I have a script where I need to get the text from line number $line in file $filename then save it to a var ($text) and then print it. For example, in the file lamb.txt (just an example file): Mary was a little lamb, whose fleece was as white as snow. I need to get line number 3 (fleece) and

Re: [PHP] Printing line x in a file

2002-05-11 Thread Miguel Cruz
On Sat, 11 May 2002, Andrew Conner wrote: I have a script where I need to get the text from line number $line in file $filename then save it to a var ($text) and then print it. For example, in the file lamb.txt (just an example file): Mary was a little lamb, whose fleece was as white as