![]() |
Here made a way to delete first 5 lines from a text file. |
<?php
$file_out = file("f.txt"); // Read the whole file into an array
//Delete the recorded line
unset($file_out[0]);
unset($file_out[1]);
unset($file_out[2]);
unset($file_out[3]);
unset($file_out[4]);
//Recorded in a file
file_put_contents("f.txt", implode("", $file_out));
?>
Category
: |
Web Tutorial |
Sub Category
: |
PHP String Tutorial |
Uploaded by
: |
Admin |