<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	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/"
		>
<channel>
	<title>Comments on: Add suffix to a number</title>
	<atom:link href="http://www.wlscripting.com/tutorial/56/feed" rel="self" type="application/rss+xml" />
	<link>http://www.wlscripting.com/tutorial/56</link>
	<description>PHP coding tutorials</description>
	<lastBuildDate>Wed, 10 Mar 2010 13:43:59 -0500</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9-beta-1</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Daniel</title>
		<link>http://www.wlscripting.com/tutorial/56/comment-page-1#comment-185363</link>
		<dc:creator>Daniel</dc:creator>
		<pubDate>Fri, 31 Jul 2009 19:27:24 +0000</pubDate>
		<guid isPermaLink="false">http://www.wlscripting.com/tutorial/56#comment-185363</guid>
		<description>Yes, it does have the same result but uses more code than the article above.

I did a test and used microtime() to calculate the start time, then looped through 1000 numbers echoing out the result for the commenter above and then used microtime() again to calculate how long it took to loop through the code. On my machine it took 0.008 seconds to echo 1000 numbers.

Doing the same with the function in the article above I came up with around: 0.002 seconds.</description>
		<content:encoded><![CDATA[<p>Yes, it does have the same result but uses more code than the article above.</p>
<p>I did a test and used microtime() to calculate the start time, then looped through 1000 numbers echoing out the result for the commenter above and then used microtime() again to calculate how long it took to loop through the code. On my machine it took 0.008 seconds to echo 1000 numbers.</p>
<p>Doing the same with the function in the article above I came up with around: 0.002 seconds.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Umm</title>
		<link>http://www.wlscripting.com/tutorial/56/comment-page-1#comment-185179</link>
		<dc:creator>Umm</dc:creator>
		<pubDate>Sat, 25 Jul 2009 09:23:15 +0000</pubDate>
		<guid isPermaLink="false">http://www.wlscripting.com/tutorial/56#comment-185179</guid>
		<description>function suffix($num){

		 if(strlen($num)&gt;=2 &amp;&amp; substr($num, (strlen($num)-2), 1)==1){
  		$suff = &quot;th&quot;;
		 } else if(substr($num, (strlen($num)-1), 1)==1){
  		$suff = &quot;st&quot;;
		 } else if(substr($num, (strlen($num)-1), 1)==2){
		  $suff = &quot;nd&quot;;
		 } else if(substr($num, (strlen($num)-1), 1)==3){
		  $suff = &quot;rd&quot;;
		 } else if(substr($num, (strlen($num)-1), 1)&gt;&gt;2 &amp;&amp; substr($num, (strlen($num)-1), 1)&lt;=9 &#124;&#124; substr($num, (strlen($num)-1), 1)==0){
		  $suff = &quot;th&quot;;
		 }

		 $suffixedNum = $num.$suff;

		 return $suffixedNum;

		}
Someone posted that way iam wondering if it even has the same result</description>
		<content:encoded><![CDATA[<p>function suffix($num){</p>
<p>		 if(strlen($num)&gt;=2 &amp;&amp; substr($num, (strlen($num)-2), 1)==1){<br />
  		$suff = &#8220;th&#8221;;<br />
		 } else if(substr($num, (strlen($num)-1), 1)==1){<br />
  		$suff = &#8220;st&#8221;;<br />
		 } else if(substr($num, (strlen($num)-1), 1)==2){<br />
		  $suff = &#8220;nd&#8221;;<br />
		 } else if(substr($num, (strlen($num)-1), 1)==3){<br />
		  $suff = &#8220;rd&#8221;;<br />
		 } else if(substr($num, (strlen($num)-1), 1)&gt;&gt;2 &amp;&amp; substr($num, (strlen($num)-1), 1)&lt;=9 || substr($num, (strlen($num)-1), 1)==0){<br />
		  $suff = &quot;th&quot;;<br />
		 }</p>
<p>		 $suffixedNum = $num.$suff;</p>
<p>		 return $suffixedNum;</p>
<p>		}<br />
Someone posted that way iam wondering if it even has the same result</p>
]]></content:encoded>
	</item>
</channel>
</rss>
