php fread() function


  Translation results:

英[ri:d] 美[ri:d]

vt.& vi.Read, read aloud; show; study; understand

vt.read; show; read Understand, understand

n.read; read; read; Reed (name)

adj. to be read aloud; knowledgeable; well-read; knowledgeable

th Third person singular: reads Present participle: reading Past tense: read Past participle: read

php fread() functionsyntax

Function: Read files (safe for binary files).

Syntax: fread(file,length)

## Parameters:

ParametersDescriptionfile Required. Specifies that the file should be opened for reading. length Required. Specifies the maximum number of bytes to read.

Description: The file pointer file reads up to length bytes. This function is called after reading up to length bytes, or when EOF is reached, or (for network streams) when a packet is available, or (after opening a userspace stream) 8192 bytes have been read. Reading of the file will stop.

php fread() functionexample

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

Home

Videos

Q&A