求教:php读文本中数据的问题 $array = file("text.txt");echo $array[0]; //显示第一行echo $array[1]; //显示第二行 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 http://blog.csdn.net/arcow/archive/2004/10/18/140916.aspx看看这个就会明白 先用tt007的方法渎出行,然后你的列应该有什么分界符把,比如“|”或者空格然后再explode,取出你要的就可以了 $handle = fopen ("/tmp/inputfile.txt", "r");$i=1;$line=15;//读取第15行while (!feof ($handle)) { $buffer = fgets($fd); if ($i==$line){ break;} $i++;}echo $buffer;fclose ($handle);?> <?php$content=file($filename);$result=substr($content[7], 18, 2);?> <?php$content=file($filename);$line_8=$content[7];//the 8th line content;$col = split($pattern,$line_8);//$pattern 边界分割字符$result = $col[18];//the result?> 帮忙该代码 一个php动态视频转换问题 setcookie无法使用? 大家来看看,这样的验证码识别难度大不? 请教门户网站用flash做的对联的关闭代码怎么写?? php 生成 html 速度问题 请教 靠!刚才发了个帖子,不知道跑到哪里了?? 急!!!!!!!!mysql表中date型数据插入格式是什么? 正在学习PHP OOP,写了一个数据库操作类,有问题,希望大牛们指点一下。 整体的出现正则如何写 mysql的like的问题 ◆◇连接远程数据库问题,web服务器,数据库服务器不是同一台电脑!!
看看这个就会明白
然后再explode,取出你要的就可以了
$i=1;
$line=15;//读取第15行
while (!feof ($handle)) {
$buffer = fgets($fd);
if ($i==$line)
{
break;
}
$i++;
}
echo $buffer;
fclose ($handle);
?>
$content=file($filename);
$result=substr($content[7], 18, 2);
?>
$content=file($filename);
$line_8=$content[7];//the 8th line content;
$col = split($pattern,$line_8);//$pattern 边界分割字符
$result = $col[18];//the result
?>