Şu anda PHP ile bir txt dosyası yazmak çalışıyorum, ben bu küçük senaryoyu buldum:
<?php
$filename = 'testFile.txt';
$somecontent = "Add this to the file\n";
if (is_writable($filename)) {
if (!$handle = fopen($filename, 'a')) {
echo "Cannot open file ($filename)";
exit;
}
if (fwrite($handle, $somecontent) === FALSE) {
echo "Cannot write to file ($filename)";
exit;
}
echo "Success, wrote ($somecontent) to file ($filename)";
fclose($handle);
}
else {
echo "The file $filename is not writable";
}
?>
Ben bir başarı mesajı alıyorum, ama hiçbir şey dosyaya yazılır. Ben txt dosyasını silmek bile ben hala başarı mesajı almak
Herkes böyle bir durum giderilir nasıl biliyor mu?