国产av日韩一区二区三区精品,成人性爱视频在线观看,国产,欧美,日韩,一区,www.成色av久久成人,2222eeee成人天堂

php creates temporary files

The files we created before are permanent files.

Creating temporary files is also very useful in our daily project development. Several benefits of creating temporary files:

Delete after finishing writing

No need to maintain the deletion status of this file

For example: I need to transfer the content of A’s file Save it in B and transfer the file contents of B to C.

Just like in real life, I can first use a temporary bottle to fill B's water, and then write A's data into B. Add the water from the temporary bottle to C.

Let’s learn this function:

resource tmpfile ( )

Function: Create a temporary file and return the resource type. The file is deleted when it is closed.

<?php
   //創(chuàng)建了一個(gè)臨時(shí)文件
   $handle = tmpfile();

   //向里面寫入了數(shù)據(jù)
   $numbytes = fwrite($handle, '寫入臨時(shí)文件');

   //關(guān)閉臨時(shí)文件,文件即被刪除
   fclose($handle);

   echo  '向臨時(shí)文件中寫入了'.$numbytes . '個(gè)字節(jié)';
?>


Continuing Learning
||
<?php //創(chuàng)建了一個(gè)臨時(shí)文件 $handle = tmpfile(); //向里面寫入了數(shù)據(jù) $numbytes = fwrite($handle, '寫入臨時(shí)文件'); //關(guān)閉臨時(shí)文件,文件即被刪除 fclose($handle); echo '向臨時(shí)文件中寫入了'.$numbytes . '個(gè)字節(jié)'; ?>
submitReset Code