function to delete a file

delete file” makes use of the built-in PHP functions chmod( ) and unlink( ).

01 <?php
02 
03 function file_delete($file)
04 { 
05     chmod($file, 0777); 
06     if(unlink($file))
07     { 
08         return true; 
09     }else{ 
10         return false; 
11     } 
12 } 
13  
14 ?>