當前位置: 首頁> 函數類別大全> file

file

把整個文件讀入一個數組中
名稱:file
分類:文件系統
所屬語言:php
一句話介紹:把文件讀入一個數組中。

實例

<span class="token php language-php"><span class="token delimiter important"><? php</span>
<span class="token function">print_r</span> <span class="token punctuation">(</span> <span class="token function">file</span> <span class="token punctuation">(</span> <span class="token string double-quoted-string">“ test.txt”</span> <span class="token punctuation">)</span> <span class="token punctuation">)</span> <span class="token punctuation">;</span>
<span class="token delimiter important">? ></span></span>

輸出:

大批
((
[0] => Hello World。測試測試!
[1] =>另一天,另一行。
[2] =>如果陣列拾取了這一行,
[3] =>那是拾音器線嗎?
)
同類函數
  • 讀取文件(可安全用於二進製文件) fread

    fread

    讀取文件(可安全用於二進製文件)
  • 返回文件路徑的信息 pathinfo

    pathinfo

    返回文件路徑的信息
  • 修改符號鏈接的所有組 lchgrp

    lchgrp

    修改符號鏈接的所有組
  • 參見unlink() 或unset()(PHP 沒有delete 關鍵詞或函數) delete

    delete

    參見unlink()或unset()(P
  • 獲取文件修改時間 filemtime

    filemtime

    獲取文件修改時間
  • 新建目錄 mkdir

    mkdir

    新建目錄
  • 獲取文件的最後訪問時間 fileatime

    fileatime

    獲取文件的最後訪問時間
  • 更改文件所有者 chown

    chown

    更改文件所有者