Dirty trick:
<?php
$line_I_want = '47';
// get a web page into an array and print it out
$fcontents = file ('http://www.php.net');
while (list ($line_num, $line) = each ($fcontents)) {
// echo "<b>Line $line_num:</b> " . htmlspecialchars ($line) . "<br>\n";
if ($line_I_want == $line_num) {
$dirty_trick = htmlspecialchars($line);
}
}
echo $dirty_trick;
?>
No knowledge of what number is the line:
<?php
// get a web page into an array and print it out
$filename = 'http://www.php.net;
$fd = fopen ($filename, 'r');
$read = fread($fd, 30000);
fclose($fd);
$search = eregi('what_comes_before_the_line_you_want(.*)what_comes_after',
$read, $printing);
echo $printing[1];
?>
--
Julio Nobrega
No matter where you go, &this.
"Kevin Garrett" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Hi guys,
>
> I'm looking to edit this to just return one particular line rather than
the
> whole file:
>
> <?php
> // get a web page into an array and print it out
> $fcontents = file ('http://www.php.net');
> while (list ($line_num, $line) = each ($fcontents)) {
> echo "<b>Line $line_num:</b> " . htmlspecialchars ($line) . "<br>\n";
> }
> ?>
>
> Can anybody help me?
> Kev
>
> _________________________________________________________________
> Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp
>
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]