<?php
//Create a temporary file
$lsfile = tmpfile();
//Write data into it
$lsshuju = fwrite($lsfile, '111Here is the data written to the temporary file');
//Output writing situation
echo 'Write ' . $lsshuju . ' characters to the temporary file<br>' ;
//Output the contents of the temporary file
$shuchu = file_get_contents($lsfile);
echo $shuchu;
//Close the temporary file
fclose($ lsfile);
?>
An error is reported when reading the content. How can I read the content correctly?