Easy Tutorial
❮ Func Mysqli Ping Func Array End ❯

PHP fgetc() Function



Definition and Usage

The fgetc() function returns a single character from an open file.

Syntax

Parameter Description
file Required. Specifies the file to check.

Tips and Notes

Note: This function is very slow when dealing with large files, so it is not used for processing large files. If you need to read a single character from a large file sequentially, use fgets() to read line by line, and then use fgetc() to process the line data sequentially.


Example 1

The above code will output:


Example 2

Reading a file character by character:

The above code will output:


❮ Func Mysqli Ping Func Array End ❯