php读取任意长度的字符串函数fread
来源:互联网 发布:修改网卡mac的软件 编辑:程序博客网 时间:2024/05/29 15:56
一 代码
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=gb2312" /><title>使用fread()函数读取文件count.txt的内容</title><style type="text/css"><!--.STYLE2 {font-size: 16px;font-weight: bold;font-family: "华文琥珀";color: #FFFFFF;}.STYLE3 {font-size: 12px}--></style></head><body><table width="592" height="277" border="0" cellpadding="0" cellspacing="0" background="images/bg.JPG"> <tr> <td width="137" align="right" valign="middle" scope="col"> </td> <td width="25" rowspan="2" align="right" valign="middle" scope="col"> </td> <td height="40" colspan="2" align="center" valign="middle" scope="col"><!-- 使用fread函数读取.php文件 --><!-- ----------------------------------------- -->使用fread()函数读取文件count.txt的内容</td> </tr> <tr> <td width="137" align="center" valign="top" scope="col"><span class="STYLE2">fread函数</span></td> <td width="405" align="left" valign="top" scope="col"><span class="STYLE3"> <?php$filename = "count.txt";//要读取的文件$fp = fopen($filename,"rb");//打开文件echo fread($fp,100);//使用fread()函数读取文件内容的前100个字节echo "<p>";echo fread($fp,filesize($filename));//输出其余的文件内容?> </span></td> <td width="25" align="center" valign="middle" scope="col"> </td> </tr> <tr> <td align="right" valign="top" class="STYLE2"> </td> <td align="right" valign="middle" class="STYLE2"> </td> <td height="20" align="center" valign="middle"> </td> <td width="25" align="center" valign="middle"> </td> </tr></table></body></html>
二 运行结果
阅读全文
0 0
- php读取任意长度的字符串函数fread
- PHP 生成任意长度的随机字符串
- php生成指定长度的任意字符串
- 任意长度的字符串输入
- 任意长度的字符串输入
- 任意长度的字符串输入
- PHP截取一定长度字符串的函数
- PHP 文件读取 fread、fgets、fgetc、file_get_contents 与 file 函数
- PHP 文件读取 fread、fgets、fgetc、file_get_contents 与 file 函数
- PHP 文件读取 fread、fgets、fgetc、file_get_contents 与 file 函数
- php取得字符串长度函数
- 任意长度的小数字符串的四舍五入
- 生成任意长度的随机字符串
- 任意长度的字符串反向输出
- 随机生成一个任意长度的字符串
- 得到任意长度的随机字符串
- 读取字符串长度的窗体
- PHP截取含中文的混合字符串长度的函数
- Python 中 and 和 or 的使用
- 我的物联网项目(五)下单渠道
- 【Dubbo实战】 Dubbo+Zookeeper+Spring整合应用篇-Dubbo基于Zookeeper实现分布式服务(二)
- JUnit4 initializationError[Runner:JUnit4](0.001s)junit4报错
- Apache cxf实现WebServices--服务端
- php读取任意长度的字符串函数fread
- docker 安装confluence 6.3.4 破解
- 懒加载和预加载
- 计算机图形学 变换矩阵
- php读取整个文件各函数比较
- 小程序获取用户openid,php获取微信小程序openid的方法
- 13.2Groovy使用ExpandoMetaClass注入方法
- Warning:The `android.dexOptions.incremental` property is deprecated and it has no effect on the buil
- JSP概述