<?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>Stump of a Muffin &#187; PHP Toppings</title>
	<atom:link href="http://muffinstump.ca/category/php_toppings/feed/" rel="self" type="application/rss+xml" />
	<link>http://muffinstump.ca</link>
	<description>A Resource for Very Little</description>
	<lastBuildDate>Tue, 06 Sep 2011 18:10:58 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>.htaccess &#8211; Denied</title>
		<link>http://muffinstump.ca/2010/03/htaccess-denied/</link>
		<comments>http://muffinstump.ca/2010/03/htaccess-denied/#comments</comments>
		<pubDate>Fri, 05 Mar 2010 21:44:23 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[PHP Toppings]]></category>
		<category><![CDATA[htaccess deny]]></category>

		<guid isPermaLink="false">http://muffinstump.ca/?p=142</guid>
		<description><![CDATA[Every wanted to keep everyone out of a directory?  Make your .htaccess file this way: deny from all Now that entire directory is &#8216;blocked&#8217; from prying eyes. How about not allowing any site visitor from parsing a resource? It goes a little like this: &#60;Files *.phpi&#62; deny from all &#60;/Files&#62; Now any file with the [...]]]></description>
			<content:encoded><![CDATA[<p>Every wanted to keep everyone out of a directory?  Make your .htaccess file this way:</p>
<blockquote><p>deny from all</p></blockquote>
<p>Now that entire directory is &#8216;blocked&#8217; from prying eyes.</p>
<p>How about not allowing any site visitor from parsing a resource?  It goes a little like this:</p>
<blockquote><p>&lt;Files *.phpi&gt;</p>
<p>deny from all</p>
<p>&lt;/Files&gt;</p></blockquote>
<p>Now any file with the extension phpi will not be parsed.</p>
]]></content:encoded>
			<wfw:commentRss>http://muffinstump.ca/2010/03/htaccess-denied/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>HTACCESS Re-Direct A Single Directory</title>
		<link>http://muffinstump.ca/2010/02/htaccess-re-direct-a-single-directory/</link>
		<comments>http://muffinstump.ca/2010/02/htaccess-re-direct-a-single-directory/#comments</comments>
		<pubDate>Tue, 02 Feb 2010 19:15:24 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[PHP Toppings]]></category>
		<category><![CDATA[directory]]></category>
		<category><![CDATA[htaccess]]></category>
		<category><![CDATA[re-direct]]></category>

		<guid isPermaLink="false">http://muffinstump.ca/?p=132</guid>
		<description><![CDATA[This will work to re-direct a single directory to a new location: # Permanent move Redirect 301 /directory/ http://newlocation.com]]></description>
			<content:encoded><![CDATA[<p>This will work to re-direct a single directory to a new location:</p>
<blockquote><p># Permanent move<br />
Redirect 301 /directory/ http://newlocation.com</p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://muffinstump.ca/2010/02/htaccess-re-direct-a-single-directory/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>HTACCESS Re-Direct Entire Site to New Location</title>
		<link>http://muffinstump.ca/2010/02/htaccess-re-direct-entire-site-to-new-location/</link>
		<comments>http://muffinstump.ca/2010/02/htaccess-re-direct-entire-site-to-new-location/#comments</comments>
		<pubDate>Tue, 02 Feb 2010 19:13:34 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[PHP Toppings]]></category>
		<category><![CDATA[htaccess]]></category>
		<category><![CDATA[re-direct]]></category>
		<category><![CDATA[site]]></category>

		<guid isPermaLink="false">http://muffinstump.ca/?p=130</guid>
		<description><![CDATA[You need to re-direct an entire site to a new location?  This will do it: # Permanent move Redirect 301 / http://newsite.com]]></description>
			<content:encoded><![CDATA[<p>You need to re-direct an entire site to a new location?  This will do it:</p>
<blockquote><p># Permanent move<br />
Redirect 301 / http://newsite.com</p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://muffinstump.ca/2010/02/htaccess-re-direct-entire-site-to-new-location/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>HTACCESS re-direct to WWW Version of Site</title>
		<link>http://muffinstump.ca/2010/01/htaccess-redirect/</link>
		<comments>http://muffinstump.ca/2010/01/htaccess-redirect/#comments</comments>
		<pubDate>Fri, 22 Jan 2010 21:29:01 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[PHP Toppings]]></category>
		<category><![CDATA[htaccess redirect]]></category>

		<guid isPermaLink="false">http://muffinstump.ca/?p=127</guid>
		<description><![CDATA[.htaccess to redirect dynamically to to the www version of the domain if the non-www version is requested: RewriteCond %{HTTP_HOST} ^([a-z-]+)\.([a-z]{2,6})$ [NC] RewriteRule ^(.*)$ http://www.%1\.%2/$1 [R=301,L]]]></description>
			<content:encoded><![CDATA[<p>.htaccess to redirect dynamically to to the www version of the domain if the non-www version is requested:</p>
<blockquote><p>RewriteCond %{HTTP_HOST} ^([a-z-]+)\.([a-z]{2,6})$ [NC]<br />
RewriteRule ^(.*)$ http://www.%1\.%2/$1 [R=301,L]</p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://muffinstump.ca/2010/01/htaccess-redirect/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Alphabetize an Array</title>
		<link>http://muffinstump.ca/2010/01/alphabetize-array/</link>
		<comments>http://muffinstump.ca/2010/01/alphabetize-array/#comments</comments>
		<pubDate>Tue, 19 Jan 2010 02:13:32 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[PHP Toppings]]></category>
		<category><![CDATA[alphetical]]></category>
		<category><![CDATA[array]]></category>

		<guid isPermaLink="false">http://muffinstump.ca/?p=119</guid>
		<description><![CDATA[Reading a directory and putting the files found into an array shouldn&#8217;t be such a big deal, right?  How about alphabetizing that array? function read_a_directory( $DIR ) { if ( is_dir( $DIR ) ) { if ( $dh = opendir( $DIR ) ) { while ( ( $file = readdir( $dh ) ) !== false [...]]]></description>
			<content:encoded><![CDATA[<p>Reading a directory and putting the files found into an array shouldn&#8217;t be such a big deal, right?  How about alphabetizing that array?</p>
<blockquote><p>function read_a_directory( $DIR )<br />
{<br />
if ( is_dir( $DIR ) )<br />
{<br />
if ( $dh = opendir( $DIR ) )<br />
{<br />
while ( ( $file = readdir( $dh ) ) !== false )<br />
{<br />
if ( $file &lt;&gt; &#8216;.&#8217; &amp;&amp; $file &lt;&gt; &#8216;..&#8217; )<br />
{<br />
$a[] = strtolower( $file ) ;<br />
$b[] = $file ;<br />
}<br />
}<br />
}<br />
}<br />
if ( is_array( $a ) )<br />
{<br />
//sort( $return );<br />
asort( $a ) ;<br />
foreach( $a AS $k =&gt; $v )<br />
{<br />
$return[]    = $b[$k] ;<br />
}<br />
}<br />
return $return;<br />
}</p></blockquote>
<p>I found myself down this path only to take care of the upper and lower case names given to some files.  Further, some were prefaced with numbers.  This little function did the work.</p>
]]></content:encoded>
			<wfw:commentRss>http://muffinstump.ca/2010/01/alphabetize-array/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Alternating</title>
		<link>http://muffinstump.ca/2009/12/alternating/</link>
		<comments>http://muffinstump.ca/2009/12/alternating/#comments</comments>
		<pubDate>Sat, 19 Dec 2009 15:54:16 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[PHP Toppings]]></category>

		<guid isPermaLink="false">http://muffinstump.ca/?p=84</guid>
		<description><![CDATA[There are dozens of ways to alternate.  The most common and visible is the background colour of your tabular data.  I use PHP to generate my HTML and the following are my two favourites: foreach( (array)$results AS $K =&#62; $V ) {$alt = ( $alt == &#8216;odd&#8217; ) ? &#8216;even&#8217; : &#8216;odd&#8217; ;} This works [...]]]></description>
			<content:encoded><![CDATA[<p>There are dozens of ways to alternate.  The most common and visible is the background colour of your tabular data.  I use PHP to generate my HTML and the following are my two favourites:</p>
<p>foreach( (array)$results AS $K =&gt; $V )</p>
<p>{$alt = ( $alt == &#8216;odd&#8217; ) ? &#8216;even&#8217; : &#8216;odd&#8217; ;}</p>
<p>This works well for in iteration variable.  But, what if you&#8217;ve got something declared before this loop and you don&#8217;t want to ask for that same declaration over and over.  ( Lack of speed kills. )</p>
<p>$i = 0 ;</p>
<p>foreach( (array)$results AS $K =&gt; $V )</p>
<p>{</p>
<p>$alt = ( eregi( &#8220;\.&#8221; , ( $i / 2 ) )  ) ? &#8216;even&#8217; : &#8216;odd&#8217; ;</p>
<p>$i++;<br />
}</p>
]]></content:encoded>
			<wfw:commentRss>http://muffinstump.ca/2009/12/alternating/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Week attempts at comedy for a very small audience:</title>
		<link>http://muffinstump.ca/2009/10/week-attempts-at-comedy-for-a-very-small-audience/</link>
		<comments>http://muffinstump.ca/2009/10/week-attempts-at-comedy-for-a-very-small-audience/#comments</comments>
		<pubDate>Fri, 23 Oct 2009 18:38:20 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[PHP Toppings]]></category>

		<guid isPermaLink="false">http://muffinstump.ca/?p=39</guid>
		<description><![CDATA[In life being type cast is not always a good thing.  In PHP &#8216;typecasting&#8217; can be a very good thing.]]></description>
			<content:encoded><![CDATA[<blockquote><p>In life being type cast is not always a good thing.  In PHP &#8216;typecasting&#8217; can be a very good thing.</p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://muffinstump.ca/2009/10/week-attempts-at-comedy-for-a-very-small-audience/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Simple Iteration</title>
		<link>http://muffinstump.ca/2009/09/simple-iteration/</link>
		<comments>http://muffinstump.ca/2009/09/simple-iteration/#comments</comments>
		<pubDate>Tue, 15 Sep 2009 04:48:36 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[PHP Toppings]]></category>
		<category><![CDATA[array]]></category>
		<category><![CDATA[php]]></category>

		<guid isPermaLink="false">http://muffinstump.ca/?p=28</guid>
		<description><![CDATA[Jamie came across this beauty: foreach ((array)$myArray as $key =&#38;gt; $val) { // Whatever code here. } Never get caught again without an array.]]></description>
			<content:encoded><![CDATA[<p>Jamie came across this beauty:<br />
<pre><pre>foreach ((array)$myArray as $key =&amp;gt; $val) {
 // Whatever code here.
}</pre></pre><br />
Never get caught again without an array.</p>
]]></content:encoded>
			<wfw:commentRss>http://muffinstump.ca/2009/09/simple-iteration/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

