How to delete or replace existing file from directory

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • mukeshrasm
    Contributor
    • Nov 2007
    • 254

    How to delete or replace existing file from directory

    Hi
    I want to delete or replace the existing file from directory using PHP. I don't want to rename the file.
  • Markus
    Recognized Expert Expert
    • Jun 2007
    • 6092

    #2
    Originally posted by mukeshrasm
    Hi
    I want to delete or replace the existing file from directory using PHP. I don't want to rename the file.
    Use unlink() to delete the file.
    You'd maybe check before with file_exists() and then use unlink()

    Comment

    Working...