function to write a string to a file

01 <? 
02 function file_write($filename, $filecontent)
03 
04     if($fp = @fopen($filename,"w "))
05     { 
06         $contents = fwrite($fp, $filecontent, 80000); 
07         fclose($fp); 
08         return true; 
09     }else{ 
10         return false; 
11     } 
12 
13 ?>