> Hey guys, I've been searching the manual for a way to grab the number
of
> lines in a file and read a particular line from it, however I found no
> solution to my problem so I'm wondering if any of you out there could
help
> me

file() will read the file into an array, one line per element, so...

$line_to_read = 55;
$file_array = file('file.txt');
echo $file_array[$line_to_read];

Remember that arrays are zero based.

---John W. Holmes...

PHP Architect - A monthly magazine for PHP Professionals. Get your copy
today. http://www.phparch.com/




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to