php 读取文本文件
用fopen打开后,一行行读,#和@开头的过滤掉,当有node>或
这样的方法怎么写呀?
#vision1.1
@fileid=0010
name=xx
id=0
orth=zzz
name=xx
id=801
orth=/btf/sub.txt
name=xx
id=101
orth=/bbs/test.txt
------解决方案--------------------
前两行的#和@过滤好处理,从
当找到
然后一行行处理判断当前行如果=$firstNode,
则读到此为止...
此是
至于....>正则处理..
------解决方案--------------------PHP code
$fn = 'data2.txt';
$fp = fopen($fn, 'r');
$s = '';
while($buf = fgets($fp)) {
if(in_array($buf{0}, array('#', '@'))) continue;
if($buf{0} == '<font color="#e78608">------解决方案--------------------</font><br>唠叨老大出手,你就可以解帖了,应该。 <div class="clear"></div>
PHP怎么学习?PHP怎么入门?PHP在哪学?PHP怎么学才快?不用担心,这里为大家提供了PHP速学教程(入门到精通),有需要的小伙伴保存下载就能学习啦!
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号