I would like to find another way to delete the contents of a text file without deleting the file itself and then recreating it.
//////statement changes the status of room from full to open
unlink("status5.txt"); //deletes the file status5.txt
$status5 = "&status5=open";
//The next three lines put the new status of full in new status5.txt
$fp = fopen("status5.txt", "a+");
$fw = fwrite($fp, $status5);
fclose($fp);
The problem is that sometime the file is not remade.