User Tools

Site Tools


uphp:functions:fclose

This is an old revision of the document!


fclose

WMPRO, WMMINI FW >= 1.0 WMMEGA FW >= 2.0

Close a file, stream or socket

Description

fclose ( int $handle )

Close a resource that has previously been opened

Parameters

handle: Valid handle of a previously opened resource

Return Value

None

Example

<? 
$f=fopen("/test.txt","r"); //open the file for reading and get the file handle
if ($f) {
  print(fgets($f)); //print the first line of the file
  fclose($f); //close the file referenced by file handle
} else {
  print("unable to open file");
}
?>

See Also

fopen() - Open a file for reading or writing

f485open() - Open the RS-485 port as a stream

fseropen() - Open the serial port as a stream

fsockopen() - Open an internet socket connection

fread() - Return bytes from a file or stream

fgets() - Return a single line from a file or stream

fwrite() - Write data to a file or stream

if - Flow control structure for conditional execution

uphp/functions/fclose.1487755292.txt.gz · Last modified: 2021/09/13 05:56 (external edit)