Re: Text Files

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




I have a TXT file in witch I'd like to suppress a line. The number of the
line is given
How can I do ?
Thanks for your help ;)

something like this should work

$lineNumber = 10;

$txtnm = "something.txt";
$txtnm = substr($txtnm, 0, -1);
$fd = fopen ($txtnm, "r");
$i = 1;
while (!feof($fd)) {
        // remove first 4 lines from file
        $lines = fgets($fd, 4096);
        if (!($i = $lineNumber)) {
                echo $lines . "<br>";
        }
        $i++;
}
fclose ($fd);


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


[Index of Archives]     [PHP Home]     [PHP Users]     [Postgresql Discussion]     [Kernel Newbies]     [Postgresql]     [Yosemite News]

  Powered by Linux