Creating a temporary file with tempnam() : Temporary file « File Directory « PHP






Creating a temporary file with tempnam()

 
<?php
$tempfilename = tempnam('/tmp','data-');
$temp_fh = fopen($tempfilename,'w') or die($php_errormsg);
fputs($temp_fh,"The current time is ".strftime('%c'));
fclose($temp_fh) or die($php_errormsg);
?>
  
  








Related examples in the same category

1.Creating a temporary file in a particular place
2.Creating a temporary file with tmpfile()