top button
Flag Notify
    Connect to us
      Site Registration

Site Registration

How to Delete a file from the Folder using PHP?

0 votes
585 views
How to Delete a file from the Folder using PHP?
posted Jul 17, 2014 by Amritpal Singh

Share this question
Facebook Share Button Twitter Share Button LinkedIn Share Button

1 Answer

0 votes

Unlink is function used to delete a file from system.
Syntax: unlink('file_path');

Example:
<?php $file = fopen('test.txt', 'a'); fwrite($file, 'how to delete file'); fclose($file); unlink('test.txt');//delete test.txt file. ?>

answer Jul 18, 2014 by Rahul Mahajan
...