Horje
How to remove first Five Line from a TXT File in PHP

Here made a way to delete first 5 lines from a text file.


How to extract first Five Line from a TXT File in PHP

Follow the Example.
index.php
Example: PHP
<?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));

?>



Related Articles
How to check if a string contain multiple specific words PHP String Tutorial
How to extract words from Sentence in PHP PHP String Tutorial
How to check if string is_numeric() Function in PHP PHP String Tutorial
How to get only text from HTML Source Code by PHP PHP String Tutorial
How to get first 3 words from a sentence by PHP PHP String Tutorial
How to work if empty value does not else PHP String Tutorial
How to remove first Five Line from a TXT File in PHP PHP String Tutorial
How to get Longest Word from a Sentence in PHP PHP String Tutorial
How to remove first character from string php PHP String Tutorial
How to count if Number is below than 10 sum PHP String Tutorial
How to get back page link PHP String Tutorial

Single Articles
How to extract first Five Line from a TXT File in PHPPHP String Tutorial

Read Full::
PHP String Tutorial
Category:
Web Tutorial
Sub Category:
PHP String Tutorial
Uploaded:
3 months ago
Uploaded by:
Admin
Views:
3
Tested on:
PHP 7



Share on: