PHP4 User manual: Function-file_php Tutorial

Source: Internet
Author: User
Tags readfile
File
(PHP 3, PHP 4 >= 4.0.0) file--read the entire file to an array description
Array file (string filename [, int use_include_path])
In addition to the file () returns an array, the other is the same as the Web site building Server scripting Class \phpphp user manual Fancyfunction.readfile.html>readfile (). Each element of the array corresponds to each line of the file, with a newline character.
Note: In the result array, each line is wrapped with the end of the line, and you can use the trim () function to remove it if you don't want the end of the line.
If you want to search for a file in the include path, you can use the optional second parameter and set it to "1".
Line $line _num:; ", Htmlspecialchars ($line),"
";} Get a webpage into the string $fcontents = Join (, file (http://www.php.net/));? >
Warning
This function cannot be used in binary!
Tip: If the "fopen wrappers" configuration is already open, you can use the URL as the file name in this function.

See ReadFile (), fopen (), Fsockopen (), and Popen ().

http://www.bkjia.com/PHPjc/532348.html www.bkjia.com true http://www.bkjia.com/PHPjc/532348.html techarticle File (PHP 3, PHP 4 >= 4.0.0) file--reads the entire file into the array description array file (string filename [, int use_include_path]) except that file () returns the number Groups, and other web-building services ...

  • Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.