Home » » fread

fread

Written By 1 on Sunday, September 30, 2012 | 6:57 PM

string fread ( resource $handle , int $length )

Binary-safe file read

fread() reads up to length bytes from the file pointer referenced by handle. Reading stops as soon as one of the following conditions is met: length bytes have been read EOF (end of file) is reached a packet becomes available or the socket timeout occurs


<?php
// get contents of a file into a string
$filename "/usr/local/something.txt";
$handle fopen($filename"r");
$contents fread($handlefilesize($filename));
fclose($handle);
?>


08.-Curso PHP-MySQL. Funciones para trabajar con archivos

0 Comment:

Post a Comment