<?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 03:10:09 -0500</pubDate>
    <ttl>30</ttl>
    <item>
      <title><![CDATA[Felix Geisendorfer's Blog: Sorting Challenge]]></title>
      <guid>http://www.phpdeveloper.org/news/8911</guid>
      <link>http://www.phpdeveloper.org/news/8911</link>
      <description><![CDATA[<p>
<i>Felix Geisendorfer</i> has a <a href="http://www.thinkingphp.org/2007/10/25/sorting-challenge/">quick little sorting example</a> posted today showing on way to sort a multi-dimensional array.
</p>
<blockquote>
Quick challenge, lets say you have an array and you want to iterate through your products by [the key of each subarray in $products] Product.ordering ASC. Whats the fastest way to do this? 
</blockquote>
<p>
<a href="http://www.thinkingphp.org/2007/10/25/sorting-challenge/">His solution</a> involves using an array_flip call on the extracted information (using Set::extract), ordering it with ksort and pushing the values back into the $product array in the right order.
</p>
<p>
Check out <a href="http://www.thinkingphp.org/2007/10/25/sorting-challenge/">the comments</a> for more examples including ones that make use of array_multisort.
</p>]]></description>
      <pubDate>Fri, 26 Oct 2007 08:42:00 -0500</pubDate>
    </item>
  </channel>
</rss>
