Home  >  Article  >  Backend Development  >  How to use fgetc function

How to use fgetc function

藏色散人
藏色散人Original
2019-02-16 11:37:047541browse

php The fgetc() function is used to read characters from the file pointer.

How to use fgetc function

php fgetc() function syntax

Function: Read a character from the file pointer.

Syntax:

fgetc(file)

Parameters:

file Required. Specifies the documents to be checked.

Description: Returns a string containing one character, which is obtained from the file pointed to by file. Returns false if EOF is encountered.

php fgetc() function example

<?php
$file = fopen("./test.txt","r");
echo fgetc($file);
?>

This article is an introduction to the PHP fgetc function. I hope it will be helpful to friends in need!

The above is the detailed content of How to use fgetc function. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Previous article:How to use fgets functionNext article:How to use fgets function