English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية
PHP Filesystem Reference Manual
The file() function reads the entire file into an array, with each element being the corresponding line from the file, including newline characters.
array file ( string $filename [, int $flags = 0 [, resource $context ]])
<?php print_r(file("/PhpProject/sample.txt")); ?>
Output Result
Array ( [0] => oldtoolbag.com [1]]=> www.oldtoolbag.com [2]]=> TP )