Current Location: Home> Function Categories> file

file

Read the entire file into an array
Name:file
Category:File system
Programming Language:php
One-line Description:Read the file into an array.

实例

<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>

输出:

Array
(
[0] => Hello World. Testing testing!
[1] => Another day, another line.
[2] => If the array picks up this line,
[3] => then is it a pickup line?
)
Similar Functions