PHPfile () function _ PHP Tutorial-php Tutorial

Source: Internet
Author: User
PHPfile () function. The PHPfile () function previously used the file function to write a WEB anti-virus program. In fact, file directly reads a txt file and saves it to the array, so I think you know it's used as the PHP file () function. I used the file function to write a WEB anti-virus program, in fact, it is the file that directly reads a txt file and saves it to the array. then I think you also know what its function is, the first line in the txt file is put into the array.

PHP file () function previously I used the file function to write a WEB anti-virus program. In fact, file directly reads a txt file and saves it to the array, so I think you know what the function is. reading a file in a file is to put the first line in the txt file into an array.

Syntax:

Definition and usage
This file () reads a file to an array.

Each array element is contained from this file, and linefeeds are still valued.

Syntax

file(path,include_path,context)

Parameter
Description
Path File path
Include_path Optional. Set this parameter to '1' if you want to search the include_path file (in php. ini) and
Context Optional. File processing within the specified range. The background is a set of options that can be modified. You can skip null.

Tip and note: This function is a binary secure PHP 4.3. (It means the two binary data, such as and character data can be written into this function ). -------------------------------------------------- ------------------------------ Example

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

Output.

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


Http://www.bkjia.com/PHPjc/445504.htmlwww.bkjia.comtruehttp://www.bkjia.com/PHPjc/445504.htmlTechArticlePHP file () function previously I used file function to write a WEB antivirus program Oh, in fact, is file to a txt file directly read and save to the array, so I think you know what it is...

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.