Home  >  Article  >  Backend Development  >  php生成文件_php基础

php生成文件_php基础

WBOY
WBOYOriginal
2016-05-17 09:41:37866browse

function rw_counterfile()
{
$fp=fopen("counter.txt","r+");
if($fp==NULL) echo "文件处理出错";
rewind($fp);//指针移到文件头
fseek($fp, 2);//指针向后移2
$point=ftell($fp);//
echo $point."
;";//
fputs($fp, xyxy, 2);//写入2个字符
rewind($fp);//
$num=fgets($fp,23);//读出字符串
echo "get:".$num."
;";//
fclose($fp);
}
rw_counterfile();
?>; 
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn