1. Computing & Technology

Discuss in my forum

Fread () PHP Function

By , About.com Guide

Definition: Fread () reads data from an external file and reports it back to your PHP file. It read the number of bytes that you specify. It is phrased as: fread ( handle, length ). You must open the file in the handle. The length is measured in bytes, with a 8192 byte maximum.
Also Known As: file read, php file read
Examples:
 $myFile = "MyFileName.txt"; 
 $handle = fopen($myFile, 'r'); 
 $Data = fread($handle, 10); 
 fclose($handle); 
 echo $Data;
 

©2012 About.com. All rights reserved.

A part of The New York Times Company.