read

The timeline below displays how wordpress function read has changed across different WordPress versions. If a version is not listed, refer to the next available version below.

WordPress Version: 6.5

/**
 * Reads bytes and advances the stream position by the same count.
 *
 * @param stream               $handle    Bytes will be read from this resource.
 * @param int                  $num_bytes Number of bytes read. Must be greater than 0.
 * @return binary string|false            The raw bytes or false on failure.
 */
function read($handle, $num_bytes)
{
    $data = fread($handle, $num_bytes);
    return ($data !== false && strlen($data) >= $num_bytes) ? $data : false;
}