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

Fread () PHP Function

By Angela Bradley, About.com

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

More from About.com

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

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

All rights reserved.