DISQUS

DISQUS Hello! Tech-Recipes is using DISQUS, a powerful comment system, to manage its comments. Learn more.

Community Page

Tech-Recipes

Cookbook of Tech Tutorials
Jump to original thread »
Author

PHP: Delete or unlink a file on the server | PHP programming | Tech-Recipes

Started by qdideas · 9 months ago

No excerpt available. Jump to website »

3 comments

  • a nice n short article on how to delete a file using PHP codes. Good work. Thank you for sharing.
  • Sometimes it's a good idea to check if the file exists first, then you won't get a PHP error if the file you're trying to delete is not there. Just add a simple IF statement to accomplish this:

    $tmpfile = "/full/path/to/delete-me.txt";
    if (file_exists($tmpfile)) { unlink ($tmpfile); }
  • hmmm.... good post...

Add New Comment

Returning? Login