LW Ellis wrote:
LW Ellis wrote:
Never mind...
As usual, about the time you ask for help, the brain gets unstuck and
you find the solution.
You should post back with a solution (append SOLVED to your subject)
so that it becomes part of the thread (and archived). This way, next
time someone else has a similar issue, they can search the archives
for the post and find the answer.
Not that many people search the archives, but hey -- here's hopin :)
My answer I'm sure there are others...
<?php
if (!($fp = fopen("test.txt", "r")))
exit("Unable to open the input file.");
while (!feof($fp))
{
$buffer[] = fgets($fp, 1024);
}
fclose($fp);
?>
// change the [0] to 1,2,3,4,...for each line of the text file you want
to display.
<? echo $buffer[0]?>
Leon
PS No I didn't want to while it.
W/out making large array in memory:
$fp = fopen("test.txt", "r")
or die("Unable to open the input file.");
$display_line = 6;
$i=1;
while (($line = fgets($fp, 1024)) !== false && $i < $display_line) $i++;
echo htmlspecialchars($line);
fclose($fp);
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php