How to delete the non-catalogue by unlink()?

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
rich
Forum Newbie
Posts: 5
Joined: Wed Aug 21, 2002 10:16 pm

How to delete the non-catalogue by unlink()?

Post by rich »

How to delete the non-catalogue by unlink()?
User avatar
gite_ashish
Forum Contributor
Posts: 118
Joined: Sat Aug 31, 2002 11:38 am
Location: India

Post by gite_ashish »

hi,

What is "non-catalogue" ?

If it is the name fo the file you want to delete, unlink() is the correct function.

If it is the name of the directory, then you need to use rmdir() to remove directory. (The directory must be empty.)

You can use is_dir()/is_file() to check the type.

For removing the file/directory, the php should have the relevant permissions on it.
Post Reply