PHP file () function _php Tutorial

Source: Internet
Author: User
PHP file () function previously I wrote a file function in the Web anti-virus program Oh, is actually file to read a TXT file directly and saved to the array, then I I think you also know what its role is it, file reading is the TXT file in the first line into the array inside

PHP file () function previously I wrote a file function in the Web anti-virus program Oh, is actually file to read a TXT file directly and saved to the array, then I I think you also know what its role is it, file reading is the TXT file in the first line into the array inside

Grammar:

Definition and usage
The file () reads a file into an array.

Each array element is contained from the file, and the line break is still attached.

Grammar

File (Path,include_path,context)
Parameter
Description
Path File path
Include_path Optional Set this parameter to ' 1 ' If you want to search for files in include_path (in php.ini), and
Context Optional File processing within the specified range. The background is a set of options that can modify the behavior of the flow. You can skip using empty.

Hints and Instructions tip: This feature becomes binary safe for php 4.3. (meaning that these two binary data, like and character data can be written to this function). --------------------------------------------------------------------------------For example

Print_r (File ("test.txt"));? >

Output.

Array ([0] = a
[1] = b.[2] = c,[3] = d?)


http://www.bkjia.com/PHPjc/445504.html www.bkjia.com true http://www.bkjia.com/PHPjc/445504.html techarticle PHP file () function I used the file function to write a in the Web antivirus program Oh, is actually file to read a TXT file directly and saved to the array, then I think you know it's done ...

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