<?xml version="1.0"?>
<rss version="2.0">
  <channel>
    <title>PHPDeveloper.org</title>
    <link>http://www.phpdeveloper.org</link>
    <description>Up-to-the Minute PHP News, views and community</description>
    <language>en-us</language>
    <pubDate>Wed, 22 May 2013 15:17:07 -0500</pubDate>
    <ttl>30</ttl>
    <item>
      <title><![CDATA[Felix Geisendorfer's Blog: New fix for array junkies: Set::merge assembles yummy arrays]]></title>
      <guid>http://www.phpdeveloper.org/news/7575</guid>
      <link>http://www.phpdeveloper.org/news/7575</link>
      <description><![CDATA[<p>
In <a href="http://www.thinkingphp.org/2007/04/05/new-fix-for-array-junkies-setmerge-assembles-yummy-arrays/">a new post</a> today, <i>Felix Geisendorfer</i> shares a method for merging together nested arrays correctly with a little help from functionality in the CakePHP framework.
</p>
<blockquote>
<p>
Todays post features a brand new Set function called merge that was a side product of me working on a cool new cake class. If you've done a lot of array work in the past, you've probably have come in situations where you wanted to merge to arrays into a new one. Usually that's a no-brainer in PHP by simply using the array_merge function (or the CakePHP wrapper 'am'):
</p>
<p>
In about 90%++ of all cases, this will the usual way to merge two (or more) arrays into a new one. However, sometimes array_merge is not going to cut it. That'll mostly be because it does not behave recursive and merging nested arrays can lead to unexpected results.
</p>
</blockquote>
<p>
He even shows <a href="http://www.thinkingphp.org/2007/04/05/new-fix-for-array-junkies-setmerge-assembles-yummy-arrays/">an example</a> of the use of array_merge_recursive to try to get his desired results. With that still not working, he turns to CakePHP to help him out. He comes up with the Set::merge method to handle the merging of the arrays in what he thinks is a "more correct" way.
</p>]]></description>
      <pubDate>Fri, 06 Apr 2007 09:29:00 -0500</pubDate>
    </item>
  </channel>
</rss>
