<?xml version="1.0" encoding="UTF-8"?>
<!-- generator="wordpress/2.2.3" -->
<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/"
	>

<channel>
	<title>PHP-Scripts Blog &#187; PHP 5.x</title>
	<link>http://www.php-scripts.com</link>
	<description>Writing about PHP scripting since 12/99. Learn something new every day.</description>
	<pubDate>Thu, 09 Oct 2008 14:17:07 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.2.3</generator>
	<language>en</language>
			<item>
		<title>Bendable runtime methods and member variables in PHP5</title>
		<link>http://www.php-scripts.com/20060222/80/</link>
		<comments>http://www.php-scripts.com/20060222/80/#comments</comments>
		<pubDate>Thu, 23 Feb 2006 03:40:39 +0000</pubDate>
		<dc:creator>TDavid</dc:creator>
		
		<category><![CDATA[PHP 5.x]]></category>

		<category><![CDATA[Information]]></category>

		<guid isPermaLink="false">http://www.php-scripts.com/20060222/80/</guid>
		<description><![CDATA[IBM:
The introduction of new object-oriented programming (OOP) features in PHP V5 has significantly raised the level of functionality in this programming language. Not only can you have private, protected, and public member variables and functions &#8212; just as you would in the Java™, C++, or C# programming languages &#8212; but you can also create objects [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www-128.ibm.com/developerworks/opensource/library/os-php-flexobj/?ca=dgr-lnxw07DynamicPHP">IBM</a>:<br />
<blockquote>The introduction of new object-oriented programming (OOP) features in PHP V5 has significantly raised the level of functionality in this programming language. Not only can you have private, protected, and public member variables and functions &#8212; just as you would in the Java™, C++, or C# programming languages &#8212; but you can also create objects that bend at runtime, creating new methods and member variables on the fly. You can&#8217;t do that with the Java, C++, or C# languages.</p></blockquote>
<p>How many readers are using PHP 5 now in a production environment? We are still using in test environment but getting closer to deploying on a production box.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.php-scripts.com/20060222/80/feed/</wfw:commentRss>
		</item>
		<item>
		<title>AJAX MyTop</title>
		<link>http://www.php-scripts.com/20060131/78/</link>
		<comments>http://www.php-scripts.com/20060131/78/#comments</comments>
		<pubDate>Tue, 31 Jan 2006 17:34:10 +0000</pubDate>
		<dc:creator>TDavid</dc:creator>
		
		<category><![CDATA[AJAX]]></category>

		<category><![CDATA[Installation and configuration]]></category>

		<category><![CDATA[PHP 5.x]]></category>

		<category><![CDATA[PHP 4.x]]></category>

		<guid isPermaLink="false">http://www.php-scripts.com/?p=78</guid>
		<description><![CDATA[Man, how many clicks does it take to get the download these days at Sourceforge? Seems like it took me a half dozen to get to the AjaxMyTop project download.

MyTop creator Jeremy Zawodny writes:
Someone has built and AJAX powered version of mytop, the little console based MySQL monitoring tool I wrote years ago. I guess [...]]]></description>
			<content:encoded><![CDATA[<p>Man, how many clicks does it take to get the download these days at Sourceforge? Seems like it took me a half dozen to get to the <a href="http://jeremy.zawodny.com/blog/archives/006199.html">AjaxMyTop project download</a>.</p>
<p><img src="http://www.php-scripts.com/images/2006/ajaxmytop.jpg" border="0"/></p>
<p>MyTop creator Jeremy Zawodny <a href="http://jeremy.zawodny.com/blog/archives/006199.html">writes</a>:<br />
<blockquote>Someone has built and AJAX powered version of mytop, the little console based MySQL monitoring tool I wrote years ago. I guess it&#8217;s now buzzword compliant.</p></blockquote>
<p><a href="http://jeremy.zawodny.com/mysql/mytop/">mytop</a> is a handy little program for monitoring MySQL queries that we&#8217;ve used in the past on a couple of our boxes so I decided to fire up this AJAX version and see how it fared. AjaxMyTop received <a href="http://ajaxian.com/archives/779">3.7 out of 5 rating at Ajaxian</a> as of this writing.</p>
<p>Installation started at 8:38am PST.  gunzip ajaxMyTop.tar.gz. tar -xvf  ajaxMyTop.tar.  Threw dom errors right away, documentation is non-existent. Error was result of PHP 5.x required for the program. Turns out <a href="http://sourceforge.net/forum/forum.php?thread_id=1431063&#038;forum_id=526557">Michael Kimsal hacked up processlist.php</a> to work in PHP4. Here is the <a href="http://www.php-scripts.com/examples/processlist.phps">PHP 4 process.php source file</a> you&#8217;ll need if you aren&#8217;t running PHP5. And no, I didn&#8217;t clean up the indenting. Total time spent on this project: 20 minutes.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.php-scripts.com/20060131/78/feed/</wfw:commentRss>
		</item>
		<item>
		<title>PHP 5.1.0 now available</title>
		<link>http://www.php-scripts.com/20051124/67/</link>
		<comments>http://www.php-scripts.com/20051124/67/#comments</comments>
		<pubDate>Fri, 25 Nov 2005 04:21:50 +0000</pubDate>
		<dc:creator>TDavid</dc:creator>
		
		<category><![CDATA[PHP 5.x]]></category>

		<guid isPermaLink="false">http://www.php-scripts.com/?p=67</guid>
		<description><![CDATA[PHP 5.1.0 has been released on Thanksgiving. Changelog
]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.php.net/downloads.php#v5">PHP 5.1.0</a> has been released on Thanksgiving. <a href="http://www.php.net/ChangeLog-5.php#5.1.0">Changelog</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.php-scripts.com/20051124/67/feed/</wfw:commentRss>
		</item>
		<item>
		<title>symfony open source php5 framework</title>
		<link>http://www.php-scripts.com/20051109/60/</link>
		<comments>http://www.php-scripts.com/20051109/60/#comments</comments>
		<pubDate>Wed, 09 Nov 2005 22:53:11 +0000</pubDate>
		<dc:creator>TDavid</dc:creator>
		
		<category><![CDATA[AJAX]]></category>

		<category><![CDATA[PHP 5.x]]></category>

		<guid isPermaLink="false">http://www.php-scripts.com/?p=60</guid>
		<description><![CDATA[Based on the concept of Rails / Django like framework only for PHP, here comes the MIT licensed symfony
]]></description>
			<content:encoded><![CDATA[<p>Based on the concept of <a href="http://www.rubyonrails.org/">Rails</a> / <a href="http://www.djangoproject.com/">Django</a> like framework only for PHP, here comes the MIT licensed <a href="http://www.symfony-project.com/">symfony</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.php-scripts.com/20051109/60/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Parsing names and numbers out of text</title>
		<link>http://www.php-scripts.com/20050923/25/</link>
		<comments>http://www.php-scripts.com/20050923/25/#comments</comments>
		<pubDate>Sat, 24 Sep 2005 04:51:28 +0000</pubDate>
		<dc:creator>TDavid</dc:creator>
		
		<category><![CDATA[Functions]]></category>

		<category><![CDATA[PHP 5.x]]></category>

		<category><![CDATA[PHP 4.x]]></category>

		<guid isPermaLink="false">http://www.php-scripts.com/?p=25</guid>
		<description><![CDATA[At one of our sites we needed to parse out some names and numbers from a log file. The strings also contained comment text and the order would be mixed format. These types of regular expression parsing can be tricky. 
Let&#8217;s take a look at the two possible formats of the strings:
FORMAT #1:
[00:02:18][jvastine]7.52..I agree with [...]]]></description>
			<content:encoded><![CDATA[<p>At one of our sites we needed to parse out some names and numbers from a log file. The strings also contained comment text and the order would be mixed format. These types of regular expression parsing can be tricky. </p>
<p>Let&#8217;s take a look at the two possible formats of the strings:</p>
<p>FORMAT #1:<br />
[00:02:18][jvastine]7.52..I agree with Rowdy, but they do have potential!</p>
<p>FORMAT #2:<br />
[00:02:18][@Forser]My vote is 5</p>
<p>Can you see a pattern for extracting the name and numbers from the string? Let&#8217;s whip up the code to parse these two types of strings as a test:</p>
<div class="codesnip-container" >
<div class="codesnip">&lt;?php<br />
<span class="re0">$text</span> = <a href="http://www.php.net/array"><span class="kw3">array</span></a><span class="br0">&#40;</span><span class="st0">&#8216;[00:02:18][jvastine]7.52..I agree with Rowdy, but they do have potential!&#8217;</span>,<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st0">&#8216;[00:02:18][@Forser]My vote is 5&#8242;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#41;</span>;<br />
<span class="kw1">foreach</span><span class="br0">&#40;</span><span class="re0">$text</span> <span class="kw1">as</span> <span class="re0">$string</span><span class="br0">&#41;</span> <span class="br0">&#123;</span><br />
&nbsp; <a href="http://www.php.net/print"><span class="kw3">print</span></a> <span class="st0">&#8220;&lt;hr&gt;testing: &#8220;</span> . <span class="re0">$string</span> . <span class="st0">&#8216;&lt;br /&gt;&#8217;</span>;<br />
&nbsp; <a href="http://www.php.net/preg_match"><span class="kw3">preg_match</span></a><span class="br0">&#40;</span><span class="st0">&#8220;/<span class="es0">\[</span>([<span class="es0">\@</span>a-z]+)<span class="es0">\]</span>([a-z ]+([0-9<span class="es0">\.</span>]+)|([0-9<span class="es0">\.</span>]+))/i&#8221;</span>,<span class="re0">$string</span>,<span class="re0">$matched</span><span class="br0">&#41;</span>;<br />
&nbsp; <a href="http://www.php.net/print"><span class="kw3">print</span></a> <span class="st0">&#8220;&lt;b&gt;$matched[1]&lt;/b&gt;&lt;br /&gt;&#8221;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">if</span><span class="br0">&#40;</span><span class="re0">$matched</span><span class="br0">&#91;</span><span class="nu0">3</span><span class="br0">&#93;</span> != <span class="st0">&#8221;</span><span class="br0">&#41;</span> <span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <a href="http://www.php.net/print"><span class="kw3">print</span></a> <a href="http://www.php.net/sprintf"><span class="kw3">sprintf</span></a><span class="br0">&#40;</span><span class="st0">&#8220;%02f&#8221;</span>,<span class="re0">$matched</span><span class="br0">&#91;</span><span class="nu0">3</span><span class="br0">&#93;</span><span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span> <span class="kw1">else</span> <span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <a href="http://www.php.net/print"><span class="kw3">print</span></a> <a href="http://www.php.net/sprintf"><span class="kw3">sprintf</span></a><span class="br0">&#40;</span><span class="st0">&#8220;%02f&#8221;</span>,<span class="re0">$matched</span><span class="br0">&#91;</span><span class="nu0">2</span><span class="br0">&#93;</span><span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span><br />
<span class="co1">// end for loop</span><br />
<span class="br0">&#125;</span><br />
<span class="kw2">?&gt;</span></div>
</div>
<p>Note the use of the sprintf() to format the number because it might be a decimal. We can trim the decimal if it&#8217;s all zeroes, but in some cases we may want to include the decimal. Also as one of my smart tech friends pointed out a string that contains multiple numbers could screw this up.</p>
<p>FORMAT #3:<br />
[00:02:18][jvastine]16 hot dogs&#8230;I vote is 7</p>
<p>Now how would we parse out the vote of 7 and ignore the 16? This one is a bit easier because we could analyze the numbers (by going to $match[4], $match[5], etc), since a valid rating is only 1-10 in the above example, but what if there was a format with multiple rating numbers?</p>
<p>FORMAT #4:<br />
[00:02:18][jvastine]6 hot dogs&#8230;I vote is 7</p>
<p>How to determine which is the vote in this case? This is a trick question. And not as easy one. Thoughts?</p>
]]></content:encoded>
			<wfw:commentRss>http://www.php-scripts.com/20050923/25/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Using header to redirect the browser</title>
		<link>http://www.php-scripts.com/20050922/24/</link>
		<comments>http://www.php-scripts.com/20050922/24/#comments</comments>
		<pubDate>Fri, 23 Sep 2005 02:16:31 +0000</pubDate>
		<dc:creator>TDavid</dc:creator>
		
		<category><![CDATA[Functions]]></category>

		<category><![CDATA[PHP 5.x]]></category>

		<category><![CDATA[PHP 4.x]]></category>

		<category><![CDATA[PHP 3.x]]></category>

		<guid isPermaLink="false">http://www.php-scripts.com/?p=24</guid>
		<description><![CDATA[The PHP header function allows redirection of the browser, among other cool things. 
Example redirecting the browser to php-scripts.com homepage:

&#60;?php
header&#40;”Location: http://www.php-scripts.com/”);
?&#62;

]]></description>
			<content:encoded><![CDATA[<p>The PHP header function allows redirection of the browser, among other cool things. </p>
<p>Example redirecting the browser to php-scripts.com homepage:</p>
<div class="codesnip-container" >
<div class="codesnip">&lt;?php<br />
<a href="http://www.php.net/header"><span class="kw3">header</span></a><span class="br0">&#40;</span>”Location: http:<span class="co1">//www.php-scripts.com/”);</span><br />
<span class="kw2">?&gt;</span></div>
</div>
]]></content:encoded>
			<wfw:commentRss>http://www.php-scripts.com/20050922/24/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Using floor and time to calculate number of days elapsed from UNIX timestamp</title>
		<link>http://www.php-scripts.com/20050921/23/</link>
		<comments>http://www.php-scripts.com/20050921/23/#comments</comments>
		<pubDate>Wed, 21 Sep 2005 20:06:51 +0000</pubDate>
		<dc:creator>TDavid</dc:creator>
		
		<category><![CDATA[Linux]]></category>

		<category><![CDATA[PHP 5.x]]></category>

		<category><![CDATA[PHP 4.x]]></category>

		<category><![CDATA[PHP 3.x]]></category>

		<category><![CDATA[Information]]></category>

		<guid isPermaLink="false">http://www.php-scripts.com/?p=23</guid>
		<description><![CDATA[Finding out the number of days elapsed from a UNIX timestamp is actually pretty straightforward. If you only know two dates then first you&#8217;ll need to convert the date to a UNIX timestamps and then subtract the most recent timestamp from the older timestamp like this:

&#60;?php
$old_timestamp = 1102971600;
$elapsed_seconds = time&#40;&#41; - $old_timestamp;
print &#8216;Seconds elapsed since [...]]]></description>
			<content:encoded><![CDATA[<p>Finding out the number of days elapsed from a UNIX timestamp is actually pretty straightforward. If you only know two dates then first you&#8217;ll need to convert the date to a UNIX timestamps and then subtract the most recent timestamp from the older timestamp like this:</p>
<div class="codesnip-container" >
<div class="codesnip">&lt;?php<br />
<span class="re0">$old_timestamp</span> = <span class="nu0">1102971600</span>;<br />
<span class="re0">$elapsed_seconds</span> = <a href="http://www.php.net/time"><span class="kw3">time</span></a><span class="br0">&#40;</span><span class="br0">&#41;</span> - <span class="re0">$old_timestamp</span>;<br />
<a href="http://www.php.net/print"><span class="kw3">print</span></a> <span class="st0">&#8216;Seconds elapsed since &#8216;</span> . <a href="http://www.php.net/date"><span class="kw3">date</span></a><span class="br0">&#40;</span><span class="st0">&#8220;m-d-Y H:i:s&#8221;</span>,<span class="re0">$old_timestamp</span><span class="br0">&#41;</span> . <span class="st0">&#8220;: &lt;b&gt;$elapsed_seconds&#8221;</span>;<br />
<span class="kw2">?&gt;</span></div>
</div>
<p>Now, let&#8217;s convert those seconds to days using the floor() function, by just adding the following code to the code above:</p>
<div class="codesnip-container" >
<div class="codesnip"><span class="coMULTI">/*<br />
divide #seconds by 60 for minutes<br />
divide #of minutes by 60 for hours<br />
divide #of hours by 24 for days<br />
use floor to get integer for day<br />
*/</span><br />
<span class="re0">$elapsed_days</span> = <a href="http://www.php.net/floor"><span class="kw3">floor</span></a><span class="br0">&#40;</span><span class="br0">&#40;</span><span class="re0">$elapsed_seconds</span> / <span class="nu0">60</span><span class="br0">&#41;</span> / <span class="nu0">60</span> / <span class="nu0">24</span><span class="br0">&#41;</span>; <br />
<a href="http://www.php.net/print"><span class="kw3">print</span></a> <span class="st0">&#8220;&lt;br /&gt;Number of days elapsed: $elapsed_days&#8221;</span>;</div>
</div>
]]></content:encoded>
			<wfw:commentRss>http://www.php-scripts.com/20050921/23/feed/</wfw:commentRss>
		</item>
		<item>
		<title>How to use preg_replace to replace phrase between question marks</title>
		<link>http://www.php-scripts.com/20050920/14/</link>
		<comments>http://www.php-scripts.com/20050920/14/#comments</comments>
		<pubDate>Tue, 20 Sep 2005 18:03:52 +0000</pubDate>
		<dc:creator>TDavid</dc:creator>
		
		<category><![CDATA[PHP 5.x]]></category>

		<category><![CDATA[PHP 4.x]]></category>

		<category><![CDATA[Information]]></category>

		<guid isPermaLink="false">http://www.php-scripts.com/?p=14</guid>
		<description><![CDATA[
&#60;?php
$string = “?This is a test that should be in single quotes quotes?”;
$text = preg_replace&#40;”/&#40;\?&#40;&#91;^\?&#93;+&#41;\?&#41;/”,”‘\\2′”,$string&#41;;
?&#62;

regular expression produces:
This is a test that should be in single quotes’
]]></description>
			<content:encoded><![CDATA[<div class="codesnip-container" >
<div class="codesnip">&lt;?php<br />
<span class="re0">$string</span> = “?This is a test that should be in single quotes quotes?”;<br />
<span class="re0">$text</span> = <a href="http://www.php.net/preg_replace"><span class="kw3">preg_replace</span></a><span class="br0">&#40;</span>”/<span class="br0">&#40;</span>\?<span class="br0">&#40;</span><span class="br0">&#91;</span>^\?<span class="br0">&#93;</span>+<span class="br0">&#41;</span>\?<span class="br0">&#41;</span>/”,”‘\\<span class="nu0">2</span>′”,<span class="re0">$string</span><span class="br0">&#41;</span>;<br />
<span class="kw2">?&gt;</span></div>
</div>
<p>regular expression produces:</p>
<p>This is a test that should be in single quotes’</p>
]]></content:encoded>
			<wfw:commentRss>http://www.php-scripts.com/20050920/14/feed/</wfw:commentRss>
		</item>
		<item>
		<title>How to make an anniversary counter announcement script using ordinal numbers</title>
		<link>http://www.php-scripts.com/20050919/22/</link>
		<comments>http://www.php-scripts.com/20050919/22/#comments</comments>
		<pubDate>Mon, 19 Sep 2005 20:01:55 +0000</pubDate>
		<dc:creator>TDavid</dc:creator>
		
		<category><![CDATA[PHP 5.x]]></category>

		<category><![CDATA[PHP 4.x]]></category>

		<category><![CDATA[Information]]></category>

		<guid isPermaLink="false">http://www.php-scripts.com/?p=22</guid>
		<description><![CDATA[Today being it is our 16th wedding anniversary I decided it would be appropriate to build a small script to keep track and post a message automatically on our special day together. I wanted this program to remember what year of our anniversary it was without me having to remind it: a great use for [...]]]></description>
			<content:encoded><![CDATA[<p>Today being it is our 16th wedding anniversary I decided it would be appropriate to build a small script to keep track and post a message automatically on our special day together. I wanted this program to remember what year of our anniversary it was without me having to remind it: a great use for a variable.</p>
<div class="codesnip-container" >
<div class="codesnip">&lt;?php<br />
<span class="re0">$anniversary_date</span> = <span class="st0">&#8216;0919&#8242;</span>;<br />
<span class="re0">$start_year</span> = <span class="nu0">1989</span>;<br />
<span class="re0">$the_suffix</span> = <span class="st0">&#8216;th&#8217;</span>;<br />
<span class="re0">$number_years</span> = <span class="br0">&#40;</span><a href="http://www.php.net/date"><span class="kw3">date</span></a><span class="br0">&#40;</span><span class="st0">&#8220;Y&#8221;</span><span class="br0">&#41;</span> - <span class="re0">$start_year</span><span class="br0">&#41;</span> . <span class="re0">$the_suffix</span>;<br />
<span class="kw1">if</span><span class="br0">&#40;</span><a href="http://www.php.net/date"><span class="kw3">date</span></a><span class="br0">&#40;</span><span class="st0">&#8220;md&#8221;</span><span class="br0">&#41;</span> == <span class="re0">$anniversary_date</span><span class="br0">&#41;</span> <span class="br0">&#123;</span><br />
&nbsp; &nbsp;<a href="http://www.php.net/print"><span class="kw3">print</span></a> <span class="st0">&#8220;Happy $number_years&nbsp; anniversary, Kara!&#8221;</span>;<br />
<span class="br0">&#125;</span><br />
<span class="kw2">?&gt;</span></div>
</div>
<p>Something worth noting is 16th, 17th, 18th, 19th and 20th will work with the $the_suffix &#8230; but what about 21st, 22nd, 23rd? Do we need to add filtering or does the date PHP function offer something to automatically provide this for us?</p>
<p>In fact it does! It&#8217;s called the &#8216;S&#8217; suffix and works good as a date parameter for dealing with this situation.  For example:</p>
<div class="codesnip-container" >
<div class="codesnip">&lt;?php<br />
<a href="http://www.php.net/print"><span class="kw3">print</span></a> <span class="st0">&#8220;today is the &#8220;</span> . <a href="http://www.php.net/date"><span class="kw3">date</span></a><span class="br0">&#40;</span><span class="st0">&#8220;dS&#8221;</span><span class="br0">&#41;</span> . <span class="st0">&#8216;of the month.&#8217;</span>; <span class="co1">// adds st, nd, rd, th</span><br />
<span class="kw2">?&gt;</span></div>
</div>
<p>This will output the proper 20th, 21st, 22nd, 23rd, 24th, etc format.</p>
<p>Now how can this be made to work on <i>any number</i>, not just a date because I&#8217;m optimistic that we&#8217;ll be together beyond 31 years. One solution is to create your own function, as robf did and posted to Zend in the way of an <a href="http://www.zend.com/codex.php?id=881&#038;single=1">ordinal($number) function</a>. </p>
<p>I remained curious, though if we could fake a date in years, and then strip the first part of the years off to cover any possible usage of anniversary numbers and not have to resort to using our own function? We can do this up until our 69th annivesary using mktime(), date and substr() functions using the following code:</p>
<div class="codesnip-container" >
<div class="codesnip">&lt;?php<br />
<span class="re0">$elapsed</span> = <a href="http://www.php.net/date"><span class="kw3">date</span></a><span class="br0">&#40;</span><span class="st0">&#8220;Y&#8221;</span><span class="br0">&#41;</span> - <span class="re0">$start_year</span> + <span class="nu0">2001</span>; <span class="co1">// add 2001</span><br />
<a href="http://www.php.net/print"><span class="kw3">print</span></a> <span class="st0">&#8220;&lt;br /&gt;Today ($elapsed) is our &#8220;</span> . <a href="http://www.php.net/substr"><span class="kw3">substr</span></a><span class="br0">&#40;</span><a href="http://www.php.net/date"><span class="kw3">date</span></a><span class="br0">&#40;</span><span class="st0">&#8220;YS&#8221;</span>,<a href="http://www.php.net/mktime"><span class="kw3">mktime</span></a><span class="br0">&#40;</span><span class="nu0">0</span>,<span class="nu0">0</span>,<span class="nu0">0</span>,<span class="nu0">0</span>,<span class="nu0">0</span>,<span class="re0">$elapsed</span><span class="br0">&#41;</span><span class="br0">&#41;</span>,<span class="nu0">2</span>,<span class="nu0">4</span><span class="br0">&#41;</span>&nbsp; . <span class="st0">&#8216; anniversary.&#8217;</span>; <span class="co1">//</span><br />
<span class="kw2">?&gt;</span></div>
</div>
<p>Definitely not the most practical code on the planet, nor anything I&#8217;d ever use beyond just playing around aloud here, but I was trying to stretch my brain for other possible ways to do this using built-in PHP functions. </p>
<p>Have I missed a built-in PHP ordinal number function that works like the S suffix in date()?</p>
<p>I&#8217;m sure my wife would rather get flowers than flowery code. I better get on that!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.php-scripts.com/20050919/22/feed/</wfw:commentRss>
		</item>
		<item>
		<title>How to PHP scripting course begins Friday 9/23/2005</title>
		<link>http://www.php-scripts.com/20050916/17/</link>
		<comments>http://www.php-scripts.com/20050916/17/#comments</comments>
		<pubDate>Fri, 16 Sep 2005 22:15:03 +0000</pubDate>
		<dc:creator>TDavid</dc:creator>
		
		<category><![CDATA[PHP 5.x]]></category>

		<category><![CDATA[PHP 4.x]]></category>

		<category><![CDATA[Information]]></category>

		<guid isPermaLink="false">http://www.php-scripts.com/?p=17</guid>
		<description><![CDATA[For those who would like to learn how to write PHP code, starting next Friday at Webmaster Cookbook, our family friendly webmaster how-to site/blog, we&#8217;ll be going through a 32 week course on PHP programming. Details will be announced during the radio show and podcast next Friday September 23, 2005 at 3:30pm PST. For those [...]]]></description>
			<content:encoded><![CDATA[<p>For those who would like to learn how to write PHP code, starting next Friday at <a href="http://www.webmastercookbook.com/">Webmaster Cookbook</a>, our family friendly webmaster how-to site/blog, we&#8217;ll be going through a 32 week course on PHP programming. Details will be announced during the radio show and podcast next Friday September 23, 2005 at 3:30pm PST. For those interested in learning how to write PHP scripts, this should prove to be a very useful course. I know a lot of really cool scripts and even full websites came out of the course when we originally debuted it over five years ago.</p>
<p>Focus will be to update this course material I wrote back in July/August 2000. We&#8217;ll be introducing many of the new PHP functions. I&#8217;m looking very forward to this course and to see what students do with it.</p>
<p>Mark your calendars.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.php-scripts.com/20050916/17/feed/</wfw:commentRss>
		</item>
	</channel>
</rss>

