Close Panel
Hello Guest! | Log In


lheader.gif rheader.gif
tgcontentlogo.gif
tgcontentlogob.gif

PHP: Delete File If Exists

I ran across this function to delete a file from the server if it exists some time ago. It has been very useful to me.

<?php
$DelFilePath = "/home/path/to/file";
if (file_exists($DelFilePath))  {
unlink($DelFilePath);
}
?>

One Comment

Leave a Reply

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>


24 user(s) currently browsing site (0 members, 24 guests, 0 anonymous)
No Members Logged In


Warning: Cannot modify header information - headers already sent by (output started at /home/tg007net/public_html/blog/wp-content/themes/tg007/header.php:3) in /home/tg007net/public_html/scriptsocket/roomlist.php on line 2
12 Users in IRCommunity
inføвøт, err0r, «Chãin™», ♥fiestýβสbỳ♥, båbyġurł, Enya, Spike1506, Timeless, «·Ħåĺø·», ﴾Ɣ﴿ⓨⓢⓣⓘⓒ★§ⓟⓔⓛⓛ, danger , [☠] Ƙʀʏᴘтιӿ [☠]



lhfooter.gif
Valid XHTML 1.0 | Valid CSS | Load Time: 0.869913 sec(s)
rfooter.gif

Strict Standards: is_a(): Deprecated. Please use the instanceof operator in /home/tg007net/public_html/blog/wp-includes/script-loader.php on line 725

Strict Standards: is_a(): Deprecated. Please use the instanceof operator in /home/tg007net/public_html/blog/wp-includes/script-loader.php on line 597