How is the callback function php curl CURLOPT_READFUNCTION used?

in the process of uploading files using curl, I see CURLOPT_READFUNCTION as a callback function. I don"t quite understand how to use it. Officials have not found a use case

.
Apr.01,2021

$ch = curl_init('http://www.yourapi.com/');
curl_setopt_array($ch, array(
    CURLOPT_HEADER => false,
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_POST => true,
    CURLOPT_INFILESIZE => 1,
    CURLOPT_READFUNCTION => 'curl_read'
));
curl_exec($ch);
curl_close($ch);
function curl_read($ch, $fp, $len) {
    var_dump($fp);
    exit;
}
MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b3279d-2be33.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b3279d-2be33.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?