$array = file("text.txt");
echo $array[0]; //显示第一行
echo $array[1]; //显示第二行

解决方案 »

  1.   

    http://blog.csdn.net/arcow/archive/2004/10/18/140916.aspx
    看看这个就会明白
      

  2.   

    先用tt007的方法渎出行,然后你的列应该有什么分界符把,比如“|”或者空格
    然后再explode,取出你要的就可以了
      

  3.   

    $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);
    ?>
      

  4.   

    <?php
    $content=file($filename);
    $result=substr($content[7], 18, 2);
    ?>
      

  5.   

    <?php
    $content=file($filename);
    $line_8=$content[7];//the 8th line content;
    $col = split($pattern,$line_8);//$pattern 边界分割字符
    $result = $col[18];//the result
    ?>