PHP unlink () yöntemi kullandıktan sonra bir 0KB dosya olsun

0 Cevap php

Ben sunucu üzerinde bir dosyayı silmek için çalışıyorum. Aşağıda kullanmak kodudur.

function ServerDel($file){
        $file = realpath($file);
        echo ($file);
        $fh = fopen($file, 'w') or die("can't open file");
        fclose($fh);
        if(unlink($file))
            echo"Delete the file successfully.";
        else
            echo "Failed to delete.";
}

Ben kodu çalıştırmak sonra, ancak, dosya hala var ve 0KB olur. Herkes bu etrafında almak için nasıl bilir?

Şimdiden teşekkürler.

0 Cevap