Posted: Mon Aug 19, 2002 11:12 pm
where did $ln come from? i understand that script u sent me now except for the $ln i know $ln_gt and $ln_lt are specified but where did just $ln come from?
A community of PHP developers offering assistance, advice, discussion, and friendship.
http://forums.devnetwork.net/
Code: Select all
<?php
$if_name = "file.ext"; // inputfile_name
$of_name = "char.txt"; // outputfile_name
if (file_exists($if_name))
{
$f_contents = file($if_name);
$fd_out = fopen($of_name, "a+"); // only appending !?
$ln_gt = 62; // linenumber_greaterthan
$ln_lt = 4320; // linenumber_lesserthan
// include 'style.css'; <- uncertain about this
// include 'header.php'; <- and that
for ($ln = $ln_gt+1; $ln < count($f_contents) && $ln < $ln_lt; $ln++)
{
fputs($fd_out, $f_contentsї$ln]);
// you still can print it out now directly
// print($f_contentsї$ln]);
}
fputs($fd_out, "</table>");
fclose($fd_out);
/* if you want to read it back now - but just as reminder:
the data is already available ;)
*/
$f_contents = file($of_name);
}
else
printf('file not found: '.$if_name);
?>fputs($fd_out, "</table>");
fclose($fd_out);
/* if you want to read it back now - but just as reminder:
the data is already available![]()
*/
$f_contents = file($of_name);
}