<?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>Sat, 25 May 2013 19:51:58 -0500</pubDate>
    <ttl>30</ttl>
    <item>
      <title><![CDATA[Chris Shiflett's Blog: Sorting Multi-Dimensional Arrays in PHP]]></title>
      <guid>http://www.phpdeveloper.org/news/16543</guid>
      <link>http://www.phpdeveloper.org/news/16543</link>
      <description><![CDATA[<p>
In a sort of "remind himself later" kind of post, <i>Chris Shiflett</i> has shared a quick example of a common task PHP developers face <a href="http://shiflett.org/blog/2011/jun/sorting-multi-dimensional-arrays-in-php">sorting a multi-dimensional array</a>.
</p>
<blockquote>
Every time I need to sort a multi-dimensional array in PHP, I have to remind myself how to do it. It's not quite as quick and easy to look up as most things, so I'm going to blog a quick example. I've always felt like there must be a better way to do this, so please let me know if there is, and I'll update this post accordingly.
</blockquote>
<p>
His method sorts a multi-dimensional array of user data using the <a href="http://php.net/array_multisort">array_multisort</a> function together with a list of the usernames in each record. In the comments, people recommend using <a href="http://php.net/usort">usort</a> instead with a callback+closure combo that keeps things nice and clean.
</p>]]></description>
      <pubDate>Fri, 01 Jul 2011 09:48:26 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Make Me Pulse Blog: Tips : RecursiveArrayIterator on mulitdimensional Array]]></title>
      <guid>http://www.phpdeveloper.org/news/9605</guid>
      <link>http://www.phpdeveloper.org/news/9605</link>
      <description><![CDATA[<p>
On the Make Me Pulse blog, <i>Antoine Ughetto</i> shares a method he came up with to recurse through an array using the SPL method - the RecursiveArrayIterator method.
</p>
<blockquote>
When we have a multidimensional array we have to make some recursives function to parse it. A simple way to get the keys and the value of this type of array is to use the <a href="http://fr2.php.net/manual/fr/ref.spl.php">SPL library of PHP</a>.
</blockquote>
<p>
A <a href="http://blog.makemepulse.com/2008/02/11/tips-recursivearrayiterator-on-mulitdimensional-array/">code example</a> is included, parsing through a recursive array to output each of the key/value pairs it contains (and using only about five or six lines of code to do it).
</p>]]></description>
      <pubDate>Mon, 11 Feb 2008 13:07:00 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[DevShed: The Switch Statement and Arrays]]></title>
      <guid>http://www.phpdeveloper.org/news/9368</guid>
      <link>http://www.phpdeveloper.org/news/9368</link>
      <description><![CDATA[<p>
DevShed continues their series looking at some of the fundamentals of working with PHP in <a href="http://www.devshed.com/c/a/PHP/PHP-The-Switch-Statement-and-Arrays/">this new tutorial</a> posted today. It looks at one of the flow control statements the language has to offer and a very useful data structure - the switch statement and arrays.
</p>
<blockquote>
In our last exciting adventure (back in early November), we braved crocodiles, ravenous editors, most of the PHP statements, and beginning loops. In this edition we'll cover the final statement, the Switch, and discuss arrays. So sit back, order your R2D2 robot to bring you a cold, frosty Jolt Cola, and let's get cracking.
</blockquote>
<p>
They start with a simple example of a switch statement (to echo out strings) and follow it with a detailed description of the different sorts of arrays - numeric indexed, associative and multidimensional versions. 
</p>]]></description>
      <pubDate>Mon, 07 Jan 2008 12:50:00 -0600</pubDate>
    </item>
  </channel>
</rss>
