Well, I have been wondering if I can handle the unlink()
function properly. I dont want the unlink()
function to throw some nasty error if it is un
If you want to only surpress the error, you can do this:
@unlink('your_file_name');
Generally, in php, @ will surpress any error.
The better way is minimize the error probability. You've say that one of error possibility is caused by non-exist file. If I were you, I'll do this:
if(file_exists('your_file_name')){
unlink('your_file_name');
}else{
echo 'file not found';
}
Good luck :)