Can PHP delete files from server?

Hi,

The application I am writing currently creates a certain number of text files whose use eventually expires. Rather than clogging up the server with this files, is there a simple command to delete them?

Understandably, most PHP textbooks don't go into great detail about deleting files from servers (because of likely misuse) but I don't see any other way round this problem. Thanks :-)

Comments

  • Yes, it can be done using the "unlink" function.. the manual page can be found at the following URL: http://us3.php.net/manual/en/function.unlink.php

    : Hi,
    :
    : The application I am writing currently creates a certain number of text files whose use eventually expires. Rather than clogging up the server with this files, is there a simple command to delete them?
    :
    : Understandably, most PHP textbooks don't go into great detail about deleting files from servers (because of likely misuse) but I don't see any other way round this problem. Thanks :-)
    :
  • Thanks mate, much appreciated!

    : Yes, it can be done using the "unlink" function.. the manual page can be found at the following URL: http://us3.php.net/manual/en/function.unlink.php
    :
    : : Hi,
    : :
    : : The application I am writing currently creates a certain number of text files whose use eventually expires. Rather than clogging up the server with this files, is there a simple command to delete them?
    : :
    : : Understandably, most PHP textbooks don't go into great detail about deleting files from servers (because of likely misuse) but I don't see any other way round this problem. Thanks :-)
    : :
    :

  • I guess you have a soulution already, but here's another tutorial.. on the unlink function:
    http://www.tizag.com/phpT/filedelete.php
    I found it helpful.



    : Thanks mate, much appreciated!
    :
  • Thanks man, that was also useful :-)

    : I guess you have a soulution already, but here's another tutorial.. on the unlink function:
    : http://www.tizag.com/phpT/filedelete.php
    : I found it helpful.
    :
    :
    :
    : : Thanks mate, much appreciated!
    : :
    :

  • www.tooLongPath.com saved me lot of time for solving this
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories