User Tools

Site Tools


uphp:functions:fclose

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
uphp:functions:fclose [2017/03/18 11:33]
jeff
uphp:functions:fclose [2021/09/13 05:57] (current)
Line 1: Line 1:
 ======fclose====== ======fclose======
 +
 <badge>WMPRO, WMMINI FW >= 1.0</badge> <badge>WMMEGA FW >= 2.0</badge> <badge>WMPRO, WMMINI FW >= 1.0</badge> <badge>WMMEGA FW >= 2.0</badge>
  
Line 5: Line 6:
  
 ====Description==== ====Description====
-<well size="sm"><html><span style="font-size:125%;"></html>[[fclose]] + 
-<html>+<well size="sm"><html> 
-<span style="color:green;">int +<span style="font-size:125%">fclose ( 
-<span style="color:blue;">$handle +<span style="color:green">int 
-<span style="color:black;">)+<span style="color:blue">$handle 
 +<span style="color:black">)
 </html></well> </html></well>
  
 Close a resource that has previously been opened Close a resource that has previously been opened
  
-====Parameters==== +====Parameter==== 
-<html><span style="color:blue;"><b>handle</b><span style="color:black;"></html>:  Valid handle of a previously opened resource+ 
 +<html><b><span style="color:blue">$handle<span style="color:black"></b></html>:  Valid handle of a previously opened resource 
 + 
 +====Return Values====
  
-====Return Value==== 
 None None
  
 ====Example==== ====Example====
 +
 <code php> <code php>
-<?  +<? 
-$f=fopen("/test.txt","r"); //open the file for reading and get the file handle +  $f=fopen("/test.txt","r"); // open the file for reading and get the file handle 
-if ($f) { +  if ($f) { 
-  print(fgets($f)); //print the first line of the file +    print(fgets($f)); // print the first line of the file 
-  fclose($f); //close the file referenced by file handle +    fclose($f); // close the file referenced by file handle 
-} else { +  } else { 
-  print("Unable to open file /test.txt"); +    print("Unable to open file /test.txt"); 
-}+  }
 ?> ?>
 </code> </code>
  
 ====See Also==== ====See Also====
 +
 [[fopen()]] - Open a file for reading or writing [[fopen()]] - Open a file for reading or writing
- 
-[[f485open()]] - Open the RS-485 port as a stream 
  
 [[fseropen()]] - Open the serial port at the specified baud rate with optional parameters [[fseropen()]] - Open the serial port at the specified baud rate with optional parameters
  
-[[fsockopen()]] - Open an internet socket connection+[[f485open()]] - Open the RS-485 port at the specified baud rate and parity 
 + 
 +[[fsockopen()]] - Open an internet socket connection with optional timeout 
 + 
 +[[fread()]] - Read bytes from a file, stream or socket 
 + 
 +[[fgets()]] - Return a single line from a file, stream or socket, with optional size limit 
 + 
 +[[fwrite()]] - Write data to a file, stream or socket
  
-[[fread()]] - Return bytes from a file or stream+[[feof()]] - Test if no more data is available in a filestream or socket
  
-[[fgets()]] - Return a single line from a file or stream, with optional size limit+[[filesize()]] - Return the size of a fileor the number of unread bytes in a stream or socket
  
-[[fwrite()]] - Write data to a file or stream+[[fseek()]] - Position the file pointer in an open file
  
-[[uphp:control_structures:if]] - Flow control structure for conditional execution+[[ftell()]] - Return the current position of a file read/write pointer
  
uphp/functions/fclose.1489836826.txt.gz · Last modified: 2021/09/13 05:56 (external edit)