Home  >  Article  >  Backend Development  >  PHP4 User Manual: Function-file_PHP Tutorial

PHP4 User Manual: Function-file_PHP Tutorial

WBOY
WBOYOriginal
2016-07-13 17:22:28803browse


file
(PHP 3, PHP 4 >= 4.0.0)file -- Read the entire file into an array description
array file (string filename [, int use_include_path])
except file() What is returned is an array, and the rest is the same as the website construction server script class PHPPHP user manual fancyfunction.readfile.html>readfile(). Each element of the array corresponds to each line of the file, with newlines.
Note: Each row in the result array contains line endings. If you don't want the line endings you can use the trim() function to remove them.
If you want to search for files in the include path, you can use the optional second parameter and set it to "1".
Line $line_num:; ", htmlspecialchars ($line), "
";}// Get a web page into a string $fcontents = join (, file (http://www.php.net/));?>
Warning
This function cannot be used for binary!
Tip: If the "fopen wrappers" configuration is turned on, you can use the URL as the file name in this function


See readfile(), fopen(), fsockopen(), and popen().

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/532348.htmlTechArticlefile (PHP 3, PHP 4 >= 4.0.0)file -- Read the entire file into the array description array file (string filename [, int use_include_path]) Except file() returns an array, the others are related to the website construction service...
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn