PHP feof function _php Tutorial

Source: Internet
Author: User
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 usage
The feof () function detects if the end of file (EOF) has been reached.

Returns an error (including the socket timeout) if the file pointer goes to EOF, or True if an error occurs, otherwise returns false.

Grammar
feof (file) parameter description
File required. Specifies the open file to check.

Description
The file parameter is a document pointer. The file pointer must be valid and must point to a file that was successfully opened by fopen () or Fsockopen () (but not yet fclose () closed).


$fh = fopen ("/home/www.bkjia.com/data/users.txt", "RT");
while (!feof ($FH)) echo fgets ($FH);
Fclose ($FH);
?>


http://www.bkjia.com/PHPjc/445445.html www.bkjia.com true http://www.bkjia.com/PHPjc/445445.html techarticle 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 Usage feof () function detection is ...

  • Related Article

    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.