i want to delete first 5 lines in a text file
Posted: Sun May 13, 2012 11:17 am
hello
iam new in php
i want to reed first 5 lines in text file
then i want to delete first 5 lines in a text file "1.txt"
i tried multi codes before
i want to make a iframe from first 5 lines in the text then delete them and update the file
iam new in php
i want to reed first 5 lines in text file
then i want to delete first 5 lines in a text file "1.txt"
i tried multi codes before
i want to make a iframe from first 5 lines in the text then delete them and update the file
Code: Select all
<?php
$myFile = "1.txt";
$lines = file($myFile);//file in to an array
{
print "<iframe width=300 height=260 src=" . $line[1] . "></iframe><br />\n";
print "<iframe width=300 height=260 src=" . $line[2] . "></iframe><br />\n";
print "<iframe width=300 height=260 src=" . $line[3] . "></iframe><br />\n";
}
$File = "1.txt";
$Handle = fopen($File, 'w');
delete($Handle, $lines[1]);
delete($Handle, $lines[2]);
delete($Handle, $lines[3]);
fclose($Handle);
?>