位组的方式读取文件。
语法: string fread(int fp, int length);
返回值: 字符串
函数种类: 文件存取
本函数读到指定长度的位组或到文件尾 EOF。
<?php$filename = "/usr/local/myfile.txt";$fd = fopen( $filename, "r" );$contents = fread($fd, filesize($filename));fclose( $fd );?>
readfile() fopen() fclose() fwrite() fgets() fgetss() file() fpassthru() popen() fsockopen()
PHP 首页 | PHP 导读 | PHP 函数库 | PHP 函数索引 | PHP 范例程序