【发布时间】:2011-08-12 03:20:13
【问题描述】:
我正在尝试使用 php 从文本文件中读取特定行。 这是文本文件:
foo
foo2
如何使用 php 获取第二行的内容? 这将返回第一行:
<?php
$myFile = "4-24-11.txt";
$fh = fopen($myFile, 'r');
$theData = fgets($fh);
fclose($fh);
echo $theData;
?>
..但我需要第二个。
任何帮助将不胜感激
【问题讨论】: