WMPRO, WMMINI FW >= 1.0 WMMEGA FW >= 2.0
Read bytes from a file, stream or socket
This function attempts to read a specified number of bytes from a file, stream or socket. If less than the number of bytes are available it will return the available data. If no data is available it will return an empty string.
$handle: Valid handle of a previously opened resource
$bytes: Limit to the number of bytes returned
<? $fp=fopen("/md5.txt","r"); if ($fp) { $data=fread($fp,32); // read 32 bytes from the file print($data); fclose($fp); } else { print("File open failed\n"); } ?>
fopen() - Open a file for reading or writing
fseropen() - Open the serial port at the specified baud rate with optional parameters
f485open() - Open the RS-485 port at the specified baud rate and parity
fsockopen() - Open an internet socket connection with optional timeout
fgets() - Return a single line from a file, stream or socket, with optional size limit
fwrite() - Write data to a file, stream or socket
feof() - Test if no more data is available in a file, stream or socket
filesize() - Return the size of a file, or the number of unread bytes in a stream or socket
fseek() - Position the file pointer in an open file
ftell() - Return the current position of a file read/write pointer
fclose() - Close a file, stream or socket