<?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>dawhoo &#187; PHP</title>
	<atom:link href="http://www.dawhoo.com/tag/php/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.dawhoo.com</link>
	<description>a little this a little that</description>
	<lastBuildDate>Thu, 12 Aug 2010 21:37:13 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>PHP Tide Clock</title>
		<link>http://www.dawhoo.com/php-tide-clock/</link>
		<comments>http://www.dawhoo.com/php-tide-clock/#comments</comments>
		<pubDate>Sat, 19 Jan 2008 15:36:29 +0000</pubDate>
		<dc:creator>dawhoo</dc:creator>
				<category><![CDATA[Scripts]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[tides]]></category>

		<guid isPermaLink="false">http://dawhoo.com/blog/2008/01/19/php-tide-clock/</guid>
		<description><![CDATA[Here&#8217;s a quick little script for predicting tides. Be sure and change the high tide time on line 2. You may have to play around with the numbers a little to get it working on your site. Please, don&#8217;t ever use this script for navigational purposes. Seriously, this is a rough estimate and not for [...]]]></description>
			<content:encoded><![CDATA[<p>Here&#8217;s a quick little script for predicting tides. Be sure and change the high tide time on line 2. You may have to play around with the numbers a little to get it working on your site. Please, <strong><span style="color: #993300;">don&#8217;t ever use this script for navigational purposes</span></strong>. Seriously, this is a rough estimate and not for marine navigation purposes.</p>
<p>Tides depend on many factors, sun, moon, wind and some other things I don&#8217;t understand. But I do understand tides differ by a set amount of time in most places &#8211; usually. I developed this code to work for Folly Beach, but it will work in locations with a 12:50 time difference between high tides. As a general rule, this works fairly well, but you will still need to update the tides occasionally or during time changes.<span id="more-9"></span></p>
<p>&lt;!&#8211;<br />
php tide by dawhoo<br />
*********************************************************************<br />
© dawhoo  2004<br />
dawhoo.com<br />
This script must be used in whole with credit in tact.<br />
php tide script by philip nicholson</p>
<p>*********************************************************************<br />
do not rely on this script for navigational purposes &#8211; serious<br />
*********************************************************************</p>
<p>Instructions:<br />
Paste into any php page an viola! There are the predicted next tides.<br />
1)Change $knowntide to the last observed high tide<br />
2)You may need to tweak the $knowntide to adjust for a server in a different time zone than  			      where the tides are being measured.<br />
&#8211;&gt;</p>
<p><span class="style1"><span style="color: #ff0000;">&lt;?php</span><br />
$knowntide = strtotime(&#8217;2007-06-25 18:30&#8242;);  // <span style="color: #008000;">known hightide use the sample format</span><br />
$current = date(U);<br />
$interval = (12 * 3600) + (25 * 60); </span><span class="style1">// <span style="color: #008000;">12 hours and 50 minutes between high tides</span></span><br />
<span class="style1"> $num_tides_passed = floor(($current &#8211; $knowntide) / $interval);<br />
$last_tide = $knowntide + ($interval * $num_tides_passed);<br />
$next_high = $last_tide + (12 * 3600) + (25 * 60); </span><span class="style1">// <span style="color: #008000;">12 hours and 50 minutes between 2 high tides</span></span><br />
<span class="style1"> $next_low = $last_tide + (6 * 3600) + (13 * 60);  <span style="color: #ff0000;">?&gt; </span></span><span class="style1">// <span style="color: #008000;">6 hours and 13 minutes between high and low</span></span></p>
<p><span class="style1"><span style="color: #ff0000;">&lt;?php</span> echo date(&#8216;m/d g:i a&#8217;, $next_low); <span style="color: #ff0000;">?&gt;</span> low </span><span class="style1">// <span style="color: #008000;">change </span></span><span style="color: #008000;"><span class="style1">&#8220;m/d g:i a&#8221; to use a different date format</span></span><br />
<span class="style1"> &lt;br&gt;&lt;font color=&#8221;blue&#8221;&gt;<br />
<span style="color: #ff0000;"> &lt;?php</span> echo date(&#8216;m/d g:i a&#8217; , $next_high);  <span style="color: #ff0000;">?&gt;</span> high<br />
&lt;br&gt;&lt;/font&gt;<br />
<span style="color: #ff0000;"> &lt;?php</span> echo date( &#8216;m/d g:i a&#8217; , $next_low + (12 * 3600) + (25 * 60)); <span style="color: #ff0000;">?&gt;</span> low&lt;br /&gt;<br />
&lt;font color=&#8221;blue&#8221;&gt;<br />
<span style="color: #ff0000;"> &lt;?php</span> echo date( &#8216;m/d g:i a&#8217; , $next_high + (12 * 3600) + (25 * 60)); <span style="color: #ff0000;">?&gt;</span> high&lt;/font&gt;<br />
&lt;br&gt;&lt;br&gt;&lt;a href=&#8221;http://www.dawhoo.com/script.html&#8221;&gt;dawhoo tide&lt;/a&gt;</span></p>
]]></content:encoded>
			<wfw:commentRss>http://www.dawhoo.com/php-tide-clock/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
	</channel>
</rss>
