php读文件代码片段

function readFromFile($fileName,&$arrOutPut){
    $handle = @fopen($fileName, "r");
    if ($handle) {
        while (!feof($handle)) {
            $buffer = fgets($handle, 4096);
            $arrOutPut[] = $buffer ;
        }
        fclose($handle);
    }
}

readFromFile("./xxx.list",$arrData);

  

 

posted on 2021-04-17 11:53  DeNiro  阅读(51)  评论(0编辑  收藏  举报

导航