fread
(PHP3 , PHP4)
fread --- 以位元组方式读档
语法 :
string fread
(int fp, int length)说明 :
fread( )从文件指标fp读取length个位元组,当length个位元组已读取或是到达文件结尾(EOF)时,停止读取。
Example :
<?php
// get contents of a file into a string
$filename = "/usr/local/something.txt";
$fd = fopen ($filename, "r");
$contents = fread ($fd, filesize ($filename));
fclose ($fd);
?>
参考 : fwrite( ) fopen( ) fsockopen( ) popen( ) fgets( ) fgetss( ) fscanf( ) file( ) fpassthru( )