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

Get all subsets of array...

If you have a list of items (for example)......

Detect leap year...

Detect leap year for gregorian and shamsi date. function gLeapYear($year) { if (($year % 4 == 0) and (($year % 100 != 0) or ($year % 400 == 0))) return true; else return ...

Number Format...

Format a number with grouped thousands......

Best way to get user ip address in php...

Here is a function to getting ip using filter of local and lan ip's. function get_ip() { $list = array( 'REMOTE_ADDR', 'CLIENT_IP', 'HTTP_CLIENT_IP', 'HTTP_PROXY_CONNECTION',...