<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>fengcool.com &#187; holiday</title>
	<atom:link href="http://www.fengcool.com/tag/holiday/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.fengcool.com</link>
	<description>Just another WordPress weblog</description>
	<lastBuildDate>Wed, 25 Jan 2012 19:09:58 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.1</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>PHP is holiday class</title>
		<link>http://www.fengcool.com/2010/01/php-is-holiday-class/</link>
		<comments>http://www.fengcool.com/2010/01/php-is-holiday-class/#comments</comments>
		<pubDate>Wed, 20 Jan 2010 04:37:01 +0000</pubDate>
		<dc:creator>rick</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[holiday]]></category>

		<guid isPermaLink="false">http://www.fengcool.com/?p=153</guid>
		<description><![CDATA[Test out is it a holiday for any given date. This class currently support United States and Canada's holidays.]]></description>
			<content:encoded><![CDATA[<p>Test out is it a holiday for any given date.</p>
<p>This class currently support United States and Canada&#8217;s holidays.</p>
<p>Here is<br />
<a href="http://en.wikipedia.org/wiki/Public_holidays_in_the_United_States">United States holidays</a> information.<br />
<a href='http://en.wikipedia.org/wiki/Canadian_holidays'>Canadian Holidays</a> information.</p>
<p>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.</p>
<p>Usage:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span>
<span style="color: #b1b100;">include_once</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;IsHoliday.php&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000088;">$h</span> <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> Holiday<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'US'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$h</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">is_holiday</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'2010-07-04'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> 
        <span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">&quot;yes, 2010-07-04 is holiday in US &lt;br&gt;&quot;</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">else</span>	
        <span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">&quot;no &lt;br&gt;&quot;</span><span style="color: #339933;">;</span>
&nbsp;
&nbsp;
<span style="color: #666666; font-style: italic;">//Using Canadian province code for specific province</span>
<span style="color: #000088;">$h</span> <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> Holiday<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'Canada'</span><span style="color: #339933;">,</span><span style="color: #0000ff;">'ON'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$h</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">is_holiday</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'2010-12-26'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> 
        <span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">&quot;yes, 2010-12-26 is holiday in Canada &lt;br&gt;&quot;</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">else</span>	
        <span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">&quot;no &lt;br&gt;&quot;</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">?&gt;</span></pre></td></tr></table></div>

<p><a href='/demo/isHoliday/php-isHoliday.rar'>Download source code here</a></p>
<a rel="external nofollow" class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?linkurl=http%3A%2F%2Fwww.fengcool.com%2F2010%2F01%2Fphp-is-holiday-class%2F&amp;linkname=PHP%20is%20holiday%20class"><img src="http://www.fengcool.com/wp-content/plugins/add-to-any/share_save_120_16.png" width="120" height="16" alt="Share/Save/Bookmark"/></a>]]></content:encoded>
			<wfw:commentRss>http://www.fengcool.com/2010/01/php-is-holiday-class/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>

