SitePoint Sponsor

User Tag List

Results 1 to 3 of 3

Threaded View

  1. #1
    Get my greedy down dotJoon's Avatar
    Join Date
    Apr 2003
    Location
    daejeon, South Korea
    Posts
    2,223
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    delete directory

    Code:
    $file = 'myFile.php'; 
    if (file_exists($file)) { 
        unlink($file); 
    }
    The code above deletes myFile.php.

    This time, I like to delete myDirectory instead of myFile.php.
    How can I delete myDirectory ?

    The would-be code below doesn't work correctly, but I hope it shows what I want.
    Code:
    $directory = 'myDirectoy'; 
    if (directory_exists($directory)) { 
        delete($directory); 
    }
    Last edited by dotJoon; Jun 25, 2013 at 15:11. Reason: adding


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •