php——读取txt文件

<?PHP
    $file_name="111.txt";
    $fp=fopen($file_name,'r');
    $hello=array();
    while(!feof($fp)){
        $buffer=fgets($fp,4096);
        $hello=explode(' ',$buffer);
    }
    for($i=0;$i<count($hello);$i++){
        echo $hello[$i].'<br/>';
    }
    fclose($fp);
?>

posted on 2012-09-12 13:19  E壶茶水  阅读(113)  评论(0)    收藏  举报

导航