PHP Classes

File: php/calendar.php

Recommend this page to a friend!
  Classes of Kabir Hossain   PHP CodeIgniter Tips Tricks   php/calendar.php   Download  
File: php/calendar.php
Role: Auxiliary script
Content type: text/plain
Description: Configuration script
Class: PHP CodeIgniter Tips Tricks
Collection of tips and examples to use CodeIgniter
Author: By
Last change:
Date: 1 month ago
Size: 747 bytes
 

Contents

Class file image Download
<?php
$first_day_this_month
= date('m-01-Y'); // hard-coded '01' for first day
$timestamp = strtotime('February 2012');
echo
$first_day_this_month;

function
lastDay($month = '', $year = '') {
   if (empty(
$month)) {
     
$month = date('m');
   }
   if (empty(
$year)) {
     
$year = date('Y');
   }
  
$result = strtotime("{$year}-{$month}-01");
  
$result = strtotime('-1 second', strtotime('+1 month', $result));
   return
date('Y-m-d', $result);
}
/* ----- gest first day of the month */

function firstDay($month = '', $year = '')
{
    if (empty(
$month)) {
     
$month = date('m');
   }
   if (empty(
$year)) {
     
$year = date('Y');
   }
  
$result = strtotime("{$year}-{$month}-01");
   return
date('Y-m-d', $result);
}

echo
date('w');