How to use tmpfile in PHP

In this article I am going to explain about tmpfile function in PHP.
  • 1279

PHP tmpfile() Function

The filesystem tmpfile function create file with unique file name in read-write mode.

Syntax of tmpfile function

tmpfile()

Example of filesystem tmpfile function

<html>

<body>

<?php

$temp = tmpfile();

fwrite($temp, "Temp File !");

rewind($temp);

echo fread($temp,1024);

fclose($temp);

?>

</body>

</html>


Output:

tempfile-php.jpg

You may also want to read these related articles :
here

Ask Your Question 

Got a programming related question? You may want to post your question here

Programming Answers here

Categories

More Articles

© 2020 DotNetHeaven. All rights reserved.