1. Home
  2. Computing & Technology
  3. PHP / MySQL

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;
Explore PHP / MySQL
About.com Special Features

Stay connected and entertained with reviews on tips on the latest HDTVs, cellphones and more. More >

Easy ways to connect two computers for networking purposes. More >

  1. Home
  2. Computing & Technology
  3. PHP / MySQL
  4. PHP Functions
  5. Fread - PHP File Read - Fread PHP

©2009 About.com, a part of The New York Times Company.

All rights reserved.