當前位置: 首頁> 函數類別大全> 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] =>那是拾音器線嗎?
)
同類函數
  • 寫入文件(可安全用於二進製文件) fwrite

    fwrite

    寫入文件(可安全用於二進製文件)
  • 用模式匹配文件名 fnmatch

    fnmatch

    用模式匹配文件名
  • 更改文件所有者 chown

    chown

    更改文件所有者
  • 拷貝文件 copy

    copy

    拷貝文件
  • 從文件指針中讀取一行 fgets

    fgets

    從文件指針中讀取一行
  • 建立一個硬連接 link

    link

    建立一個硬連接
  • 打開進程文件指針 popen

    popen

    打開進程文件指針
  • 倒回文件指針的位置 rewind

    rewind

    倒回文件指針的位置