码迷,mamicode.com
首页 > Web开发 > 详细

php fseek ftell

时间:2017-07-18 09:58:11      阅读:147      评论:0      收藏:0      [点我收藏+]

标签:char   php   and   pen   content   utf-8   指针   header   fopen   

<?php
header(‘Content-Type: text/html; charset=utf-8‘);
$file = ‘./php34.txt‘;   // ./php34.txt 里面的内容:01234567890
$mode = ‘r+‘;
$file_handle = fopen($file, $mode);


echo ‘<br>‘, ftell($file_handle);  //0
fseek($file_handle, 3);//该函数把文件指针从当前位置向前或向后移动到新的位置,新位置从文件头开始以字节数度量。
echo ‘<br>‘, ftell($file_handle);//3
echo ‘<br>‘, fgets($file_handle, 3);//34

 

php fseek ftell

标签:char   php   and   pen   content   utf-8   指针   header   fopen   

原文地址:http://www.cnblogs.com/huodaihao/p/7198476.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!