Prova con:
Codice PHP:
 $file_name="utenti/file.estensione"
 
$complete_path=$file_name;
 
$var=fopen($complete_path,"r+");
 
$fp fopen($complete_path,"r+");
     
fseek($fp0SEEK_SET); //Mi posiziono al "0°" carattere
     
fwrite($var,"scrivi tutto");   
 
fclose($fp);