Posts Tagged ‘PHP’

PHP is holiday class

Test out is it a holiday for any given date.

This class currently support United States and Canada’s holidays.

Here is
United States holidays information.
Canadian Holidays information.

This PHP class supports different provinces have its own provincial holidays. For example, December 26th is statutory holiday for Ontario and New Brunswick in Canada.

Usage:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
<?php
include_once("IsHoliday.php");
 
$h = new Holiday('US');
if($h->is_holiday('2010-07-04')) 
        echo "yes, 2010-07-04 is holiday in US <br>";
else	
        echo "no <br>";
 
 
//Using Canadian province code for specific province
$h = new Holiday('Canada','ON');
if($h->is_holiday('2010-12-26')) 
        echo "yes, 2010-12-26 is holiday in Canada <br>";
else	
        echo "no <br>";
?>

Download source code here

  • Share/Save/Bookmark

Check Linux Versions – common commands part1

  • Check Linux Kernel version:

uname -a

  • Check Linux version

cat /proc/version

  • Check Redhat based Linux version

cat /etc/redhat-release

  • Check PHP version on Linux server

php -v

  • Check mysql version on linux server

mysql -V

  • Check apache version on linux server

httpd -v

  • Share/Save/Bookmark