Line Range From File

Line Range From File Script is used to read first line from file and read end line from file.

Demo :



File Name :  about_sachin_tendulkar.txt
Read First Line From File
Read End Line From File
Out Put  :
   

Example :

If you need to read first line from text file you check "Read First Line From File" check box and click submit button the out put will be display below of form and second read end line from file that is if you check "Read End Line From File" check box and click the last line will be display.

Code :

Following code is use to line range from file if you need to copy and use to your website.


<?php
$data = file('../../free-php-scripts/file-and-directory-script/upload_files/line-range-from-file/about_sachin_tendulkar.txt') or die("Cannot read file");
   echo $data[0];
   echo end($data);
?>

In the above example $data variable is used to store file path and in this example have two type inputs that one is Read First Line From File and second one is Read End Line From File. In the Read First Line From File is used to read a content first line from source file and Read End Line From File is used to read all content from file.

Free Download Script :

If you need to Line Range From File Script click and download from following link.

Download




Content