How can the return value of fwrite() be deactivated or hidden in PHP to prevent it from being displayed on the page?

To prevent the return value of fwrite() from being displayed on the page, you can simply assign the return value to a variable and not output it. This way, the return value will still be stored for further processing or error checking, but it will not be displayed to the user.

// Assign the return value of fwrite() to a variable
$result = fwrite($file, $data);

// Do not output the return value to prevent it from being displayed on the page