Click here to Skip to main content
15,884,629 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
i have lot of files below structure:
main folder->sample1
sub folder->sub1
another sub folder->sub2
another sub folder->sub3
Posted
Updated 15-Feb-15 19:29pm
v3

1 solution

This is all your need:
http://php.net/manual/en/function.delete.php[^],
http://www.php.net/manual/en/function.unlink.php[^].

Don't be confused with the name unlink. This call really deletes a file. If you created multiple hard links (I can hardly believe that), only one will be deleted, according to the file name passed.

Hard links (as well as soft links) are supported by all Unix file systems, but also by NTFS and Windows; too bad not too many developers are aware of it and use this fact.

—SA
 
Share this answer
 
Comments
IBRAHIMFARIS 16-Feb-15 1:32am    
but these are all (unlink or unset) function only delete a file not a directory.can you give me any idea for deleting whole directory after zipping of that directory.
thanks in advance.
Sergey Alexandrovich Kryukov 16-Feb-15 1:44am    
Okay, a directory. Look, isn't it so difficult to find a function you need? Do you know how many are there?
Look: http://php.net/manual/en/function.rmdir.php...
—SA
IBRAHIMFARIS 16-Feb-15 5:17am    
Thanks a lot SA.it's very helpful to me.
Sergey Alexandrovich Kryukov 16-Feb-15 10:08am    
No problem.
Please use PHP.net...
—SA
IBRAHIMFARIS 16-Feb-15 10:26am    
Okay i will use PHP.net

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900