Delete file function

If file exists then delete the file.

function delFile( $file_name )
{
   if ( file_exists( $file_name ) ) // Does '$file_name' exist
      {
      unlink( $file_name );
      return true;
   }
   return false;
}

Tags

No tag here.

Recommended pages

PHP subwords() Function...

Function subwords, gets words by max num....

Change timestamp to custom format...

Use this function for change timestamp to custom format......

Random string generator...

Random string generator. Optionally, you can give it a desired string length. function rnd_string($len = 24) { $str = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"; $str...

Better parse_str in php...

parse_str() is fine for simple stuff but it's not the same as PHP's built way of creating the $_GET magic variable. Why?!?......