Creating a temporary file in a particular place : Temporary file « File Directory « PHP






Creating a temporary file in a particular place

 
<?php
$dir = dirname($existing_file);
$temp = tempnam($dir,'temp');
$temp_fh = fopen($temp,'w');
?>
  
  








Related examples in the same category

1.Creating a temporary file with tempnam()
2.Creating a temporary file with tmpfile()