← All built-ins / fgetc()

fgetc()

fgetc(...$args): string

Parameters

NameTypeDescription
$handleresourcehandle from fopen()

Return value

One character per call.

Example

file_put_contents("/tmp/hphp_doc_gc.txt", "ab");
$fh = fopen("/tmp/hphp_doc_gc.txt", "r");
echo fgetc($fh), fgetc($fh);
fclose($fh);
ab

See also

fgets()fread()