Read Text or txt File Script

Read Text File Script is use to when you upload a .txt file to server in this file read and display the file content to a user.

Demo :



 

Example :

Just click Browse... button then select .txt file and click Upload button then you can see to result.

Code :

Following code is use to read content from uploade .txt file if you need to copy and use to your website.


<?php
  $file_name = "File name";
  $dataStr = file_get_contents("upload_files/read-content-from-file-demo/".$file_name);
  echo $dataStr;
?>

In the above $file_name variable is use to assign a file name and file_get_contents() function is use to read content from a file. which function have in two arguments that is string filename,[bool use_include_path]."upload_files/read-content-from-file-demo/" is this path used to store at all files.

Free Download Script :

If you need Read text From File Script click and download from following link.

Download




Content