文件操作

来源:互联网 发布:看外汇行情的软件 编辑:程序博客网 时间:2024/06/07 02:35
PHP
$myfile = 'wtndata/statistic.txt';$file_pointer = fopen($myfile,"a");fwrite($file_pointer,$str);fclose($file_pointer);
读取行:
string fgets ( int handle [, int length] )
从 handle 指向的文件中读取一行并返回长度最多为 length - 1 字节的字符串。碰到换行符(包括在返回值中)、EOF 或者已经读取了 length - 1 字节后停止(看先碰到那一种情况)。如果没有指定 length,则默认为 1K,或者说 1024 字节。

0 0