<?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/"
	>

<channel>
	<title>Oranges Turn Gold &#187; NERD ALERT!</title>
	<atom:link href="http://www.calebwhang.com/tag/nerd-alert/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.calebwhang.com</link>
	<description>From The OC To The Golden Gate</description>
	<pubDate>Sun, 12 Apr 2009 16:07:02 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.7</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Our Love Language</title>
		<link>http://www.calebwhang.com/2009/03/25/our-love-language/</link>
		<comments>http://www.calebwhang.com/2009/03/25/our-love-language/#comments</comments>
		<pubDate>Wed, 25 Mar 2009 22:00:16 +0000</pubDate>
		<dc:creator>Caleb</dc:creator>
		
		<category><![CDATA[Coding]]></category>

		<category><![CDATA[NERD ALERT!]]></category>

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

		<guid isPermaLink="false">http://blog.calebwhang.com/?p=255</guid>
		<description><![CDATA[The following is an actual email that I sent to my wife today. Â It&#8217;s talking about a coding function that I&#8217;ve been using that I find very handy. Â Please feel privileged that I am sharing such personal, lovey-dovey material.
Subject:
FFOTD - Favorite Function of the Day
Body:
 http://www.php.net/manual/en/function.array-diff-key.php
array array_diff_key ( array $array1 , array $array2 [, array [...]]]></description>
			<content:encoded><![CDATA[<p>The following is an actual email that I sent to my wife today. Â It&#8217;s talking about a coding function that I&#8217;ve been using that I find very handy. Â Please feel privileged that I am sharing such personal, lovey-dovey material.</p>
<blockquote><p><strong>Subject:<br />
</strong>FFOTD - Favorite Function of the Day</p>
<p><strong>Body:</strong><br />
<a href="http://www.php.net/manual/en/function.array-diff-key.php" target="_blank"> http://www.php.net/manual/en/function.array-diff-key.php</a></p>
<p><span style="font-family: mceinline;"><strong>array array_diff_key ( array $array1 , array $array2 [, array $... ] )</strong></span></p>
<p>Here&#8217;s the situation:</p>
<ul>
<li>I&#8217;m checking to see if the currently logged in user has certain roles to access a page</li>
<li>I have 2 arrays, 1) the roles the user has, 2) the roles that they should have for access  &lt;= key&#8217;s set to the role_id</li>
</ul>
<p>Instead of running a nested loop to see if the user has those roles, I just use <strong>array_diff_key</strong> to see what the deltas of the array keys are in  both arrays.  If there&#8217;s a delta, then NO ACCESS.  If there&#8217;s no delta, then they are all good!</p>
<p>woot!</p></blockquote>
<p>Anyone wanna go on a double-date with us?</p>
]]></content:encoded>
			<wfw:commentRss>http://www.calebwhang.com/2009/03/25/our-love-language/feed/</wfw:commentRss>
		</item>
	</channel>
</rss>
