<?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 08:59:23 -0500</pubDate>
    <ttl>30</ttl>
    <item>
      <title><![CDATA[Bjarte Karlsen's Blog: Sorting with uasort]]></title>
      <guid>http://www.phpdeveloper.org/news/6599</guid>
      <link>http://www.phpdeveloper.org/news/6599</link>
      <description><![CDATA[<p>
<i>Bjarte Karlsen</i> has a <a href="http://phpmeus.blogspot.com/2006/10/sorting-with-usaort.html">handy tip</a> posted to his blog today - one array function to keep in mind when doing more than just the basic sorting - <a href="http://www.php.net/manual/en/function.uasort.php">uasort</a>.
</p>
<blockquote>
<p>
Problem: You have an array of objects or a multidimentional arrays where the key of the first array has some meaning. It could be a id or something else. You want to sort the array and maintain the key=>value association.
</p>
<p>
Some may then proceed to loop the array and sort it in a loop, however there is a easier method. 
</p>
</blockquote>
<p>
He reminds us that the fucntion allows you to take in the array and, based on a user-defined function, sort the results, keeping the association between the keys and values.
</p>]]></description>
      <pubDate>Mon, 30 Oct 2006 13:25:00 -0600</pubDate>
    </item>
  </channel>
</rss>
