<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xml:base="http://jennyandlih.com" xmlns:dc="http://purl.org/dc/elements/1.1/">
<channel>
 <title>PHP</title>
 <link>http://jennyandlih.com/note-type/tech/php</link>
 <description>The taxonomy view.</description>
 <language>en</language>
<item>
 <title>Union of array values in PHP</title>
 <link>http://jennyandlih.com/union-array-values-php</link>
 <description>	&lt;p&gt;The &lt;a href=&quot;http://www.php.net/manual/en/language.operators.array.php&quot;&gt;array union operator&lt;/a&gt; &lt;code&gt;($a + $b)&lt;/code&gt; calculates a union using array keys.  An efficient method for achieving a union of array values follows.&lt;/p&gt;

	&lt;p&gt;&lt;code&gt;&lt;br /&gt;
The union of two sets is all the elements from both sets, with duplicates removed. The array_merge( ) and array_unique( ) functions let you calculate the union.&lt;/p&gt;&lt;p&gt;&lt;a href=&quot;http://jennyandlih.com/union-array-values-php&quot;&gt;read more&lt;/a&gt;&lt;/p&gt;</description>
 <comments>http://jennyandlih.com/union-array-values-php#comments</comments>
 <category domain="http://jennyandlih.com/note-type/tech/php">PHP</category>
 <pubDate>Wed, 16 Mar 2011 21:13:50 -0600</pubDate>
 <dc:creator>jenny</dc:creator>
 <guid isPermaLink="false">2219 at http://jennyandlih.com</guid>
</item>
<item>
 <title>Anonymous Objects in PHP</title>
 <link>http://jennyandlih.com/anonymous-objects-php</link>
 <description>&lt;blockquote&gt;&lt;div class=&quot;quote_start&quot;&gt;&lt;div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;quote_end&quot;&gt;&lt;div&gt;&lt;/div&gt;&lt;/div&gt;&lt;p&gt;
For real quick and dirty one-liner anonymous objects, just cast an associative array:&lt;/p&gt;
&lt;p&gt;&lt;div class=&quot;codeblock&quot;&gt;&lt;code&gt;&lt;span style=&quot;color: #000000&quot;&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;&amp;lt;?php&lt;br /&gt;$obj &lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;= (object) array(&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&#039;foo&#039; &lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;=&amp;gt; &lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&#039;bar&#039;&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&#039;property&#039; &lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;=&amp;gt; &lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&#039;value&#039;&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;);&lt;br /&gt;&lt;br /&gt;echo &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$obj&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;foo&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;; &lt;/span&gt;&lt;span style=&quot;color: #FF8000&quot;&gt;// prints &#039;bar&#039;&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;echo &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$obj&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;property&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;; &lt;/span&gt;&lt;span style=&quot;color: #FF8000&quot;&gt;// prints &#039;value&#039;&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;?&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/div&gt;&lt;/p&gt;
&lt;p&gt;... no need to create a new class or function to accomplish it.
&lt;/p&gt;&lt;/blockquote&gt;
&lt;p&gt;Source: &lt;a href=&quot;http://www.php.net/manual/en/language.oop5.php#84292&quot; title=&quot;http://www.php.net/manual/en/language.oop5.php#84292&quot;&gt;http://www.php.net/manual/en/language.oop5.php#84292&lt;/a&gt;&lt;/p&gt;
</description>
 <comments>http://jennyandlih.com/anonymous-objects-php#comments</comments>
 <category domain="http://jennyandlih.com/note-type/tech/php">PHP</category>
 <pubDate>Wed, 18 Nov 2009 19:42:49 -0700</pubDate>
 <dc:creator>jenny</dc:creator>
 <guid isPermaLink="false">1992 at http://jennyandlih.com</guid>
</item>
</channel>
</rss>

