public static function rmfile($file)
    {
        if (is_file($file)) {
            return chmod($file, 0777) && unlink($file);
        } else {
            throw new RuntimeException(sprintf(
                'Invalid file path supplied "%s"', $file
            ));
        }
    }
public static function rmfile($file)
    {
        if (is_file($file)) {
            return chmod($file, 0777) && unlink($file);
        } else {
            throw new RuntimeException(sprintf(
                'Invalid file path supplied "%s"', $file
            ));
        }
    }
public static function rmfile ( $ file ) { if ( is_file ( $ file ) ) { return chmod ( $ file , 0777 ) && unlink ( $ file ) ; } else { throw new RuntimeException ( sprintf ( 'Invalid file path supplied "%s"' , $ file ) ) ; } }
Safely removes a file

@param string $file
@throws \RuntimeException When invalid file provided
@return boolean
Safely removes a file