PHP Learning : How Read Text File in php - Publik Talk

Breaking

An informative website for every one.

Post Top Ad

Post Top Ad

Thursday, August 3, 2017

PHP Learning : How Read Text File in php

Description:

The PHP fread() function is used to read data of the file. It requires two arguments: file resource and file size.


Code:

<?php

$myfile = 'check.txt';

$handle = fopen($myfile, 'r');

$data = fread($handle,filesize($myfile));

echo "$data";

?>


Output:


No comments:

Post a Comment

Post Top Ad