$conffile = "./conf.php"; $fh = fopen($conffile, 'w') or die("can't open file"); $stringData = ""$site\n""; fwrite($fh, $stringData); fclose($fh);