Delete file

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
S_henry
Forum Contributor
Posts: 148
Joined: Sun Jan 25, 2004 10:25 pm
Location: M'sia

Delete file

Post by S_henry »

At this time I only can upload the file (eg .txt, .xls) into a folder and save that file name into a table. The problem is I don't know how to delete that file from the folder after I've uploaded it. Anybody got any idea?
dipit
Forum Newbie
Posts: 12
Joined: Thu Apr 08, 2004 2:36 am
Location: india
Contact:

hi

Post by dipit »

use

void delete ( string file)
or
unlink()
S_henry
Forum Contributor
Posts: 148
Joined: Sun Jan 25, 2004 10:25 pm
Location: M'sia

Post by S_henry »

Sorry. Actually I'm not very clear with that funtion. Can anybody explain more detail pls?
User avatar
vigge89
Forum Regular
Posts: 875
Joined: Wed Jul 30, 2003 3:29 am
Location: Sweden

Post by vigge89 »

[php_man]unlink[/php_man]

Code: Select all

<?php

$filename = 'somefile.txt';
unlink ($filename);

?>
S_henry
Forum Contributor
Posts: 148
Joined: Sun Jan 25, 2004 10:25 pm
Location: M'sia

Post by S_henry »

Ok. It really work. Thanx guys..
Post Reply