Delete a file in the file system. Note that this file system we’re talking about is the server’s file system. PHP nor other web-based programming language deletes a file system on the client’s side.

function deleteFile($filename) {
  $do = unlink($filename);

  if ($do=="1") {
    echo "The file was deleted successfully.";
  } else {
    echo "There was an error trying to delete the file.";
  }
}

This code gets the date difference manually, specifying a date value.

$digest_date = "2009-12-25";
$date_diff = abs(strtotime(date('y-m-d'))-strtotime($digest_date)) / 86400;

and another version in a method if you want to keep on reusing this code.

function dateDiff($dformat, $endDate, $beginDate) {
  $date_parts1=explode($dformat, $beginDate);
  $date_parts2=explode($dformat, $endDate);
  $start_date=gregoriantojd($date_parts1[0], $date_parts1[1], $date_parts1[2]);
  $end_date=gregoriantojd($date_parts2[0], $date_parts2[1], $date_parts2[2]);
  return $end_date - $start_date;
}

Transition from Windows to Mac OS is pretty hard. It wasn’t easy for me at first considering I’ve been used to using Windows for more than a decade now. Both do have standard keyboard shortcuts but the symbols that Mac uses is kinda different.

The sequence of symbols in a shortcut means that these keys should all be pressed in order to have the desired action be invoked. This does not mean though, that for example a shortcut needs 3 key buttons, you would need to have 3 key buttons pressed at the same time.

You can either press 1 of them first, then the 2nd (while still having the 1st key pressed), then the 3rd. The same way you do with 2 key button shortcuts under Windows. Here is a small guide for you noobs out there.

Related Posts Plugin for WordPress, Blogger...