Blogger Information
Blog 3
fans 0
comment 2
visits 1710
Related recommendations
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
002
duziteng的博客
Original
664 people have browsed it

<?php
   $fp=fopen('e:\\test.txt','a+');
   echo fread($fp,10);
   rewind($fp);
   echo '<br>';
   echo fread($fp,10);
   echo '<br>';
   echo fseek($fp,10);
   echo '<br>';
   echo fread($fp,10);
   echo '<br>';
   fclose($fp);
?>

test.txt内容“12345678901234567890”

输出

1234567
1234567
0
8901234567

为什么第一次输出的不是1234567890呢,长度为10,应该十个啊,数字不是每个一字节的吗,萌新总有这种白痴问题。。。去找答案喽

Statement of this Website
The copyright of this blog article belongs to the blogger. Please specify the address when reprinting! If there is any infringement or violation of the law, please contact admin@php.cn Report processing!
All comments Speak rationally on civilized internet, please comply with News Comment Service Agreement
2 comments
duziteng 2017-12-15 15:09:12
但是这样,中文就乱码了,烦,慢慢想办法解决...
2 floor
duziteng 2017-12-15 15:08:09
好了,找到问题了,我的txt文件时UTF8编码的(为了能显示中文),改成ANSI就正常了
1 floor
Author's latest blog post
  • 001
    2017-12-13 11:18:57