The following text: This article mainly introduces the PHP file read and write operation related function Summary, this article summarizes fwrite (), Fread (), fgets (), fgetc (), file (), ReadFile () and other functions of the introduction and use
PHP fgets () function is used to read a row from the file pointer, the function can be combined with the feof function to read the contents of the file, this article to share with you PHP use Fgets () read/Get the file content of a simple example
Use the PHP function fgets to read pointer files. PHP function fgets -- read a line from the file pointer. stringfgets (inthandle [, intlength]) reads a line from the file pointed to by handle and returns a line with a maximum length of-1
PHP function Fgets--reading a line from the file pointerstring fgets (int handle [, int length])
Reads a row from the file pointed to by handle and returns a string of up to length-1 bytes in length. Stop after encountering a newline character
In the PHP language, there are many powerful functions that support the language's continuous development, and the pie allows more and more programmers to start choosing the language. PHP function fgets is one of the powerful functions.
PHP
One day learning a new PHP function (2) fgetcsv ()/fgets ()
File read and write is a frequent action, read the function of the file is thousands of, complex, simple also has. Most commonly used conveniently have file_get_contents (),
Learn a new php function (2) fgetcsv ()/fgets (), fgetcsvfgets
Reading and Writing files is a common action. There are thousands of functions for reading files, which are complex and simple. The most common and convenient operations are
Php
the Fgets () function reads a row from the file pointer.
its syntax is:
Fgets (File,length)
Parameters
Description
File
Necessary. Specifies the file to be read.
Length
Optional. Specifies the
File read and write is a frequent action, read the function of the file is thousands of, complex, simple also has. Most commonly used conveniently have file_get_contents (), file_put_conents (), do not need to open the file, close the operation of
fgets-reading a line from the file pointer
Description
String fgets (Resource $handle [, int $length])
Reads a row from the file pointer.
Parameters
The handle file pointer must be valid and must point to a file that was successfully opened by
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.