Phpfgetc function _ PHP Tutorial

Source: Internet
Author: User
Phpfgetc function. Phpfgetc function fgetc (in PHP4, in PHP5) fgetc-gets a character from the file pointer description string fgetc (resource $ processing) to get a character from the given file pointer. Parameter handle php fgetc function

Fgetc
(PHP 4 and PHP 5)

Fgetc-get the character pointer from the file

Description
String fgetc (resource $ processing)
Gets a character pointer from a given file.

Parameters

Handle
The file pointer must be valid and must point to a file that successfully opens fopen () or fsockopen () (and has not closed fclose ()).


Return value
Returns a string containing a single character to read the file pointed by processing. Returns the false eof analysis.

Warning
This function may return a Boolean error, and can return a non-Boolean value calculated as false, such as 0 or "". Read some Boolean values carefully for more information. Use the ===operator to test the return value function.

Instance

Example #1 fgetc ()

$ Fp = fopen('somefile.txt ', 'r ');
If (! $ Fp ){
Echo 'could not open file somefile.txt ';
}
While (false! ==( $ Char = fgetc ($ fp ))){
Echo "$ charn ";
}
?>


The http://www.bkjia.com/PHPjc/445481.htmlwww.bkjia.comtruehttp://www.bkjia.com/PHPjc/445481.htmlTechArticlephp fgetc function fgetc (PHP 4, PHP 5) fgetc-gets a character from the file pointer description string fgetc (resource $ processing) to get a character from the given file pointer. Parameter handle...

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.