<?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>Chris Roland &#187; PHP</title>
	<atom:link href="http://www.chrisroland.info/category/php/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.chrisroland.info</link>
	<description>Software, Web and Database Developer</description>
	<lastBuildDate>Sat, 14 Aug 2010 14:34:51 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.5</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Remove empty array elements in PHP</title>
		<link>http://www.chrisroland.info/remove-empty-array-elements-in-php/</link>
		<comments>http://www.chrisroland.info/remove-empty-array-elements-in-php/#comments</comments>
		<pubDate>Thu, 26 Nov 2009 02:23:56 +0000</pubDate>
		<dc:creator>Chris Roland</dc:creator>
				<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://www.chrisroland.info/?p=208</guid>
		<description><![CDATA[Here is a quick tip on how to remove elements with empty values.  All you have to use is the array_filter($myarray) function.  Here is an example.

$myarray = array();
$myarray[] = 1;
$myarray[] = '';
$myarray[] = 'a';
print_r($myarray);
Array
(
     [0] => 1
     [1] =>
     [2] => [...]]]></description>
			<content:encoded><![CDATA[<p>Here is a quick tip on how to remove elements with empty values.  All you have to use is the array_filter($myarray) function.  Here is an example.</p>
<p><code><br />
$myarray = array();<br />
$myarray[] = 1;<br />
$myarray[] = '';<br />
$myarray[] = 'a';</p>
<p>print_r($myarray);</p>
<p>Array<br />
(<br />
     [0] => 1<br />
     [1] =><br />
     [2] => a<br />
)<br />
</code></p>
<p>When you use array_filter() this is what you get:<br />
<code><br />
$myarray = array_filter($myarray);<br />
print_r($myarray);</p>
<p>Array<br />
(<br />
     [0] => 1<br />
     [1] => a<br />
)<br />
</code></p>
<p>Of course you can use array_filter with a callback function to intelligently remove elements, but if you just want to remove empty values, this is the best way.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.chrisroland.info/remove-empty-array-elements-in-php/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PHP-GTK who knew GTK could look so good</title>
		<link>http://www.chrisroland.info/php-gtk-who-knew-gtk-could-look-so-good/</link>
		<comments>http://www.chrisroland.info/php-gtk-who-knew-gtk-could-look-so-good/#comments</comments>
		<pubDate>Sat, 07 Nov 2009 06:11:51 +0000</pubDate>
		<dc:creator>Chris Roland</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[PHP-GTK]]></category>

		<guid isPermaLink="false">http://www.chrisroland.info/?p=199</guid>
		<description><![CDATA[Looking good as in tasty, yummy, delicious.  Not as in, hey nice hair or where did you buy that shirt.
I&#8217;m a Qt kind of guy when it comes to OSS GUI frameworks and really Qt is more than that.  However lately I&#8217;m spending some of my time in PHP.  I really enjoy [...]]]></description>
			<content:encoded><![CDATA[<p>Looking good as in tasty, yummy, delicious.  Not as in, hey nice hair or where did you buy that shirt.</p>
<p>I&#8217;m a Qt kind of guy when it comes to OSS GUI frameworks and really Qt is more than that.  However lately I&#8217;m spending some of my time in PHP.  I really enjoy developing in PHP and I&#8217;m always trying to find new and fun ways to use a language I spend time in.  Since PHP is primarily a web development language, I wanted to see what libraries/frameworks were out there to support desktop application development with PHP.</p>
<p>I looked at <a href="http://www.php-qt.org/">PHP-Qt</a>, however I feel that project still has a ways to go before I can start using it.  Keep in mind, I work on a Windows box all day and I didn&#8217;t want to have to jump through the cygwin hoop.  I think they will have good support for Windows soon, but I want something that I can use now.</p>
<p>I did some more research and came across the <a href="http://gtk.php.net/">PHP-GTK</a> project.  The first thing I look for in a framework project is the documentation.  I was surprised to see the amount of <a href="http://gtk.php.net/manual/en/">documentation </a>and with some code samples.  The docs are not perfect, but they provide me with what I need.  </p>
<p>Demos are the second thing I look for.  I want to see how it will work, how the code is compiled/ran and if I can run it on my system.  Within a couple minutes of unzipping a folder, I was up and running.</p>
<p>So, if you are a PHP developer looking to develop a desktop application, I would consider taking a look at PHP-GTK.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.chrisroland.info/php-gtk-who-knew-gtk-could-look-so-good/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>The Great PHP on Windows Contest!</title>
		<link>http://www.chrisroland.info/the-great-php-on-windows-contest/</link>
		<comments>http://www.chrisroland.info/the-great-php-on-windows-contest/#comments</comments>
		<pubDate>Fri, 06 Nov 2009 00:37:35 +0000</pubDate>
		<dc:creator>Chris Roland</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[Windows]]></category>

		<guid isPermaLink="false">http://www.chrisroland.info/?p=180</guid>
		<description><![CDATA[php&#124;architect is running a contest called The Great PHP on Windows Contest.  Basically you can tell from the title, this is a contest about PHP and Windows.  The challenge is to develop a PHP application, desktop or web, that runs on Windows.  You get bonus points for using Microsoft technology, like SQL [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.phparch.com/c/phpa/main/index">php|architect</a> is running a contest called The Great PHP on Windows Contest.  Basically you can tell from the title, this is a contest about PHP and Windows.  The challenge is to develop a PHP application, desktop or web, that runs on Windows.  You get bonus points for using Microsoft technology, like SQL Server, Azure, etc.  </p>
<p>For more details you can check out <a href="http://www.phparch.com/win">the contest page</a>.</p>
<p>I signed for the contest and they accepted my entry!  My project is Task HUD, a task management web application, should be awesome.  Not just for the contest, but because this is something I need.  Even though nothing is up yet, you can keep track of the progress of Task HUD at <a href="http://www.taskhud.com">http://www.taskhud.com</a>.</p>
<p>I&#8217;m excited to be a part of this contest and I look forward to what the <a href="http://www.phparch.com/win/entries">other entries</a> are developing.</p>
<p>If you use twitter, you can follow what people are saying, using the <a href="http://twitter.com/#search?q=%23winphp">#winphp</a> hash tag and you can follow <a href="http://twitter.com/phparch">@phparch</a>.</p>
<p>If you are a PHP developer, you should sign up, because by the way, did I mention the sweet prizes? no? well, you need to <a href="http://www.phparch.com/win/p/prizes">check them out for yourself</a>.</p>
<p>One last thing, I would like to thank <a href="http://www.appliedi.net/">Applied Innovations</a> for hosting my entry on their servers, rock on.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.chrisroland.info/the-great-php-on-windows-contest/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>CakePHP home page controller and view</title>
		<link>http://www.chrisroland.info/cakephp-home-page-controller-and-view/</link>
		<comments>http://www.chrisroland.info/cakephp-home-page-controller-and-view/#comments</comments>
		<pubDate>Tue, 08 Sep 2009 18:32:08 +0000</pubDate>
		<dc:creator>Chris Roland</dc:creator>
				<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://www.chrisroland.info/?p=159</guid>
		<description><![CDATA[Hopefully this will save someone time, because the locations are a little off.
Here are the default files for the CakePHP home page controller and view.
Controller:
[cake install location]\cake\libs\controller\pages_controller.php
View:
[cake install location]\app\views\pages\home.ctp
I&#8217;m using CakePHP 1.2, so this might be a little different for earlier releases.
]]></description>
			<content:encoded><![CDATA[<p>Hopefully this will save someone time, because the locations are a little off.</p>
<p>Here are the default files for the CakePHP home page controller and view.</p>
<p>Controller:<br />
<code>[cake install location]\cake\libs\controller\pages_controller.php</code></p>
<p>View:<br />
<code>[cake install location]\app\views\pages\home.ctp</code></p>
<p>I&#8217;m using CakePHP 1.2, so this might be a little different for earlier releases.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.chrisroland.info/cakephp-home-page-controller-and-view/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Find differences in both arrays with PHP</title>
		<link>http://www.chrisroland.info/find-differences-in-two-arrays-with-php/</link>
		<comments>http://www.chrisroland.info/find-differences-in-two-arrays-with-php/#comments</comments>
		<pubDate>Tue, 08 Sep 2009 01:30:16 +0000</pubDate>
		<dc:creator>Chris Roland</dc:creator>
				<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://www.chrisroland.info/?p=153</guid>
		<description><![CDATA[Sometimes something looks easy, but it turns out to be a rabbit hole.  Take for example the function array_diff in PHP.  I thought it would return all the differences in both arrays, but it doesn&#8217;t.  After going through the function comments thread, I came across a great solution.  It&#8217;s to the [...]]]></description>
			<content:encoded><![CDATA[<p>Sometimes something looks easy, but it turns out to be a rabbit hole.  Take for example the function <a href="http://us3.php.net/manual/en/function.array-diff.php">array_diff</a> in PHP.  I thought it would return all the differences in both arrays, but it doesn&#8217;t.  After going through the function comments thread, I came across a great solution.  It&#8217;s to the point and it works!</p>
<p>To get the differences in both arrays, you can use:<br />
<code>array_merge(array_diff($array1, $array2),array_diff($array2, $array1));</code></p>
<p>For example:<br />
<code><br />
$array1 = array('John', 'B', 'Smith');<br />
$array2 = array('John', 'C', 'Smith');</p>
<p>$result = array_merge(array_diff($array1, $array2),array_diff($array2, $array1));</p>
<p>print_r($result);<br />
</code></p>
<p>will return:<br />
<code><br />
Array<br />
(<br />
    [0] => B<br />
    [1] => C<br />
)<br />
</code></p>
<p>Basically the first call to array_diff returns the differences in $array1 and then the second call returns the differences in $array2.  After that, they are merged together as an array, to provide all the differences in both arrays.  Simple and sweet.</p>
<p>Credit goes to this <a href="http://us3.php.net/manual/en/function.array-diff.php#60320">comment</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.chrisroland.info/find-differences-in-two-arrays-with-php/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
