PHP fgetc function _php Tutorial

Source: Internet
Author: User
PHP fgetc functions

Fgetc
(PHP 4, PHP 5)

Fgetc-Gets the character from the file pointer

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

Parameters

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


return value
Returns a string containing a single character read by the file, indicated by the processing. Returns the EOF analysis for false.

Warning
This feature may return a Boolean error, and can also return a non-Boolean value that evaluates to false, such as 0 or "". Please read some of the booleans carefully for more information. Use the = = = operator to test the return value of this function.

Instance

Example # 1 fgetc () example

$fp = fopen (' somefile.txt ', ' R ');
if (! $fp) {
Echo ' Could not open file Somefile.txt ';
}
while (false!== ($char = fgetc ($fp))) {
echo "$charn";
}
?>


http://www.bkjia.com/PHPjc/445481.html www.bkjia.com true http://www.bkjia.com/PHPjc/445481.html techarticle php fgetc function fgetc (PHP 4, PHP 5) fgetc-Gets the character from the file pointer describing the string fgetc (resource $ processing) gets a character from the given file pointer. Parameter handle ...

  • 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.