<?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>Dougy Mak&#039;s Blog &#187; Programming Stuff</title>
	<atom:link href="http://dougymak.com/category/programming-stuff/feed/" rel="self" type="application/rss+xml" />
	<link>http://dougymak.com</link>
	<description>MY BLOG!</description>
	<lastBuildDate>Fri, 25 Jun 2010 00:22:28 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.6</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>[PHP] Uppercase &amp; Lowercase</title>
		<link>http://dougymak.com/php-uppercase-lowercase/</link>
		<comments>http://dougymak.com/php-uppercase-lowercase/#comments</comments>
		<pubDate>Thu, 14 Jan 2010 11:21:04 +0000</pubDate>
		<dc:creator>DougyMak</dc:creator>
				<category><![CDATA[Programming Stuff]]></category>
		<category><![CDATA[Techy Stuff]]></category>
		<category><![CDATA[Website Stuff]]></category>

		<guid isPermaLink="false">http://dougymak.com/?p=1061</guid>
		<description><![CDATA[Another few functions for I find useful:

ucfirst() &#8211; Make a string&#8217;s first character uppercase
lcfirst() &#8211; Make a string&#8217;s first character lowercase
strtolower() &#8211; Make a string lowercase
strtoupper() &#8211; Make a string uppercase
ucwords() &#8211; Uppercase the first character of each word in a string

From the looks of things, ucfirst() was coined from it&#8217;s function uppercase first letter [...]]]></description>
			<content:encoded><![CDATA[<p>Another few functions for I find useful:</p>
<ul>
<li>ucfirst() &#8211; Make a string&#8217;s first character uppercase</li>
<li>lcfirst() &#8211; Make a string&#8217;s first character lowercase</li>
<li>strtolower() &#8211; Make a string lowercase</li>
<li>strtoupper() &#8211; Make a string uppercase</li>
<li>ucwords() &#8211; Uppercase the first character of each word in a string</li>
</ul>
<p>From the looks of things, ucfirst() was coined from it&#8217;s function uppercase first letter (unlike some functions!). So goes for lcfirst() and ucwords(): lowercase first letter and uppercase first letter of each word. strtolower() lowercases every letter in every word in a string and strupper() functions in opposite, uppercases each letter in every word in a string.</p>
<p>ucfirst() examples:</p>
<p style="padding-left: 30px;"><code>&lt;?php<br />
$foo = 'hello world!';<br />
$foo = ucfirst($foo); // Hello world!</code></p>
<p style="padding-left: 30px;"><code>$bar = 'HELLO WORLD!';<br />
$bar = ucfirst($bar); // HELLO WORLD!<br />
$bar = ucfirst(strtolower($bar)); // Hello world!<br />
?&gt;</code></p>
<p>lcfirst() examples:</p>
<p style="padding-left: 30px;"><code>&lt;?php<br />
$foo = 'HelloWorld';<br />
$foo = lcfirst($foo);             // helloWorld</code></p>
<p style="padding-left: 30px;"><code><br />
$bar = 'HELLO WORLD!';<br />
$bar = lcfirst($bar);             // hELLO WORLD!<br />
$bar = lcfirst(strtoupper($bar)); // hELLO WORLD!<br />
?&gt;</code></p>
<p>strtolower() examples:</p>
<p style="padding-left: 30px;"><code>&lt;?php<br />
$str = "Mary Had A Little Lamb and She LOVED It So";<br />
$str = strtolower($str);<br />
echo $str; // Prints mary had a little lamb and she loved it so<br />
?&gt;</code></p>
<p>strtoupper() examples:</p>
<p style="padding-left: 30px;"><code>&lt;?php<br />
$str = "Mary Had A Little Lamb and She LOVED It So";<br />
$str = strtoupper($str);<br />
echo $str; // Prints MARY HAD A LITTLE LAMB AND SHE LOVED IT SO<br />
?&gt;</code></p>
<p>ucwords() examples:</p>
<p style="padding-left: 30px;"><code><br />
&lt;?php<br />
$foo = 'hello world!';<br />
$foo = ucwords($foo);             // Hello World!</code></p>
<p style="padding-left: 30px;"><code><br />
$bar = 'HELLO WORLD!';<br />
$bar = ucwords($bar);             // HELLO WORLD!<br />
$bar = ucwords(strtolower($bar)); // Hello World!<br />
?&gt;</code></p>
]]></content:encoded>
			<wfw:commentRss>http://dougymak.com/php-uppercase-lowercase/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>[PHP] Rounding up and down</title>
		<link>http://dougymak.com/php-rounding-up-and-down/</link>
		<comments>http://dougymak.com/php-rounding-up-and-down/#comments</comments>
		<pubDate>Wed, 06 Jan 2010 16:04:09 +0000</pubDate>
		<dc:creator>DougyMak</dc:creator>
				<category><![CDATA[Programming Stuff]]></category>
		<category><![CDATA[Techy Stuff]]></category>
		<category><![CDATA[Website Stuff]]></category>

		<guid isPermaLink="false">http://dougymak.com/?p=1036</guid>
		<description><![CDATA[I just discovered a few cool functions:

ceil() &#8211; Round fractions up
floor() &#8211; Round fractions down
round() &#8211; Rounds a float

I&#8217;m guessing ceil() is short for ceiling. When looking up, you have a ceiling whereas when looking down, you have a floor(). The functions&#8217; names correspond to their actual function which makes it pretty easy to remember. [...]]]></description>
			<content:encoded><![CDATA[<p>I just discovered a few cool functions:</p>
<ul>
<li>ceil() &#8211; Round fractions up</li>
<li>floor() &#8211; Round fractions down</li>
<li>round() &#8211; Rounds a float</li>
</ul>
<p>I&#8217;m guessing ceil() is short for ceiling. When looking up, you have a ceiling whereas when looking down, you have a floor(). The functions&#8217; names correspond to their actual function which makes it pretty easy to remember. And then we also have round which is just basic rounding.</p>
<p>ceil() examples:</p>
<p style="padding-left: 30px;"><code>&lt;?php<br />
echo ceil(4.3); // 5<br />
echo ceil(9.999); // 10<br />
echo ceil(-3.14); // -3<br />
?&gt;</code></p>
<p>floor() examples:</p>
<p style="padding-left: 30px;"><code>&lt;?php<br />
echo floor(4.3); // 4<br />
echo floor(9.999); // 9<br />
echo floor(-3.14); // -4<br />
?&gt;</code></p>
<p>round() examples:</p>
<p style="padding-left: 30px;"><code>&lt;?php<br />
echo round(3.4); // 3<br />
echo round(3.5); // 4<br />
echo round(3.6); // 4<br />
echo round(3.6, 0); // 4<br />
echo round(1.95583, 2); // 1.96<br />
echo round(1241757, -3); // 1242000<br />
echo round(5.045, 2); // 5.05<br />
echo round(5.055, 2); // 5.06<br />
?&gt;<br />
&lt;?php<br />
echo round(9.5, 0, PHP_ROUND_HALF_UP); // 10<br />
echo round(9.5, 0, PHP_ROUND_HALF_DOWN); // 9<br />
echo round(9.5, 0, PHP_ROUND_HALF_EVEN); // 10<br />
echo round(9.5, 0, PHP_ROUND_HALF_ODD); // 9echo round(8.5, 0, PHP_ROUND_HALF_UP); // 9<br />
echo round(8.5, 0, PHP_ROUND_HALF_DOWN); // 8<br />
echo round(8.5, 0, PHP_ROUND_HALF_EVEN); // 8<br />
echo round(8.5, 0, PHP_ROUND_HALF_ODD); // 9<br />
?&gt;</code></p>
]]></content:encoded>
			<wfw:commentRss>http://dougymak.com/php-rounding-up-and-down/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
