1
I am trying to delete a txt file in php and I am experiencing an error
Warning: unlink() expects parameter 1 to be a valid path, resource given in C:\xampp\htdocs\CoreContactos(4)\download.php on line 6
My code is here
<?php
include("conexao.php");
$arquivo=fopen("emails.txt", 'w');
if ($arquivo == false) die('Não foi possível criar o arquivo.');
sleep(10);
if(!unlink($arquivo)){
echo"Erro";
}
else
{
echo"apagado";
}
?>