(PHP 4, PHP 5)
feof-the test file pointer to the end of the file
If the server does not close the connection that was opened by Fsockopen (), feof () will wait until the timeout returns true. The default time-out limit is 60 seconds, and you can
10.8.45.3.15
In the official PHP manual, the feof () function has a lot of discussions and related tests have been conducted.
test feof () in PHP () function effect bool2str (= "TRUE"} "FALSE" = '. /7bytesfile '= (, 'R '(! ("File opening
Returns an error (including the socket timeout) if the file pointer goes to EOF, or TRUE If an error occurs, otherwise returns FALSE.
Definition and usageThe feof () function detects if the end of file (EOF) has been reached.
Returns an error
This is the original code:#include int main (){FILE * FP;int ch;fp = fopen ("D:\\aaaaa\\1.txt", "R");while (!feof (FP)){ch = getc (FP);Putchar (CH);}Fclose (FP);return 0;}When you output it, you'll see that the output has a "space" in the end.This
Returns TRUE if the file pointer is to EOF or if an error occurs, otherwise an error is returned, including the socket timeout, and FALSE for other cases.
Syntax: feof (file)
Parameter description
File required, which specifies the open files to
The return value of this function is written in msdn as follows:FeofFunction returns a nonzero value after the first read operation that attempts to read past the end of the file. It returns 0 if the current position is not end of file.
For example,
If the file pointer reaches EOF or an error occurs, TRUE is returned. Otherwise, an error (including socket timeout) is returned. Otherwise, FALSE is returned.
Definition and usageThe feof () function checks whether it has reached the end of the
In the C language, or more accurately, the end of file is represented in the C standard library ). In the while LOOP, EOF is used as the end mark of the file, which must be a text file. In text files, data is stored in the form of ASCII code values
Bool
Feof (
Resource $ Handle ):
Tests for end-of-file on a file pointer
The original words above the PHP manual.
I used this for convenience.
Code highlighting produced by Actipro CodeHighlighter
reprinted from: http://blog.csdn.net/xidianzhimeng/article/details/235412891 fopenFunction prototype: File * fopen (const char * path,const char * mode); return value: When the file is opened successfully, the pointer to the stream will be returned.
SyntaxFeof (file) parameter descriptionFile is required. Specifies the file to be checked.DescriptionThe file parameter is a file pointer. The file pointer must be valid and point to a file that is successfully opened (but not closed) by fopen () or
Phpfeof function. The following is a special feof tutorial with implementations. The following is a special feof tutorial with implementations. Feof (PHP4, PHP5) feof-the end file of the test file refers to a special feof tutorial, implementation,
In Windows, when writing programs with file operations, you may encounter a strange phenomenon. In the process of reading a file in text format, the feof () function is unexpectedly true before the end of the file. This is surprising, and it is hard
/* Main functions:1. Input basic information of new books.2. Show All records3. query the basic information of a book by its name.4. Delete the withdrawn book information based on the book name.5. sort by book name from small to large.6. count the
In C language, everyone should be familiar with a symbol, that is, EOF (End of File), that is, the File Terminator. However, this understanding is often not very clear, leading to frequent errors when writing code, especially when determining
PHP advanced application for PHP file processing allows you to locate and query file pointers, so as to quickly query required information. file pointer functions include rewind (), fseek (), feof () and ftell () functions. In the previous article
The eof () function checks whether the object has reached the end of the object (eof). If the object pointer to EOF or an error occurs, TRUE is returned. Otherwise, an error (including socket timeout) is returned. In other cases
The eof () function
There are many ways to read a file in PHP. reading a file is more flexible and convenient than opening a file and writing a file. PHP provides several functions for developers to choose from in actual project development. let's take a look at these
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.