<?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>Tue, 21 May 2013 17:03:59 -0500</pubDate>
    <ttl>30</ttl>
    <item>
      <title><![CDATA[Brian Swan's Blog: Sorting Azure Table Entities by Timestamp with PHP]]></title>
      <guid>http://www.phpdeveloper.org/news/16258</guid>
      <link>http://www.phpdeveloper.org/news/16258</link>
      <description><![CDATA[<p>
<i>Brian Swan</i> has a quick new post to his blog for the PHP + Azure users out there on how to easily <a href="http://blogs.msdn.com/b/brian_swan/archive/2011/04/26/sorting-azure-table-entities-by-timestamp-with-php.aspx">sort table entities by a timestamp</a> through the <a href="http://phpazure.codeplex.com/">Azure SDK for PHP</a>. The timestamp is a property on the parent storage table class, so you don't need to create it in your entity, it's already there.
</p>
<blockquote>
The problem boils down to sorting an array of objects by a timestamp property, so the information here is nothing that hasn't been done before. However, after spending some time looking for a way to use a filter in the Windows Azure SDK for PHP API, I didn't find one, so I'm hoping this post might save others some time. In the end, my solution simply uses the PHP <a href="http://us2.php.net/array_multisort">array_multisort</a> function.
</blockquote>
<p>
Sample code is included - a basic class extending Microsoft_WindowsAzure_Storage_TableEntity, a fetch for the entity set of the contacts and using a custom "objSort" method that sorts based on the returned timestamp values from the object set.
</p>]]></description>
      <pubDate>Wed, 27 Apr 2011 10:48:17 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[ProDevTips: Sorting 2D-arrays in PHP - anectodes and reflections]]></title>
      <guid>http://www.phpdeveloper.org/news/9363</guid>
      <link>http://www.phpdeveloper.org/news/9363</link>
      <description><![CDATA[<p>
On the ProDevTips website today, there's <a href="http://www.prodevtips.com/2008/01/06/sorting-2d-arrays-in-php-anectodes-and-reflections/">a new article</a> looking at the sorting of arrays, specifically of the two- and three-dimensional sort. 
</p>
<blockquote>
One of the many problems with PHP that detractors are eager to point out is the fact that the language has thousands of global functions. Without the awesome CHM version of the PHP manual - finding your way in this jungle would be a mess. Simply finding a function like array_multisort is not trivial. And even if you find it, understanding it completely is not trivial either!
</blockquote>
<p>
Not quite finding what he needed in the <a href="http://www.php.net/array_multisort">array_multisort</a> function built into PHP, the author opts to create his own custom sorting function that make sorting 2D arrays simpler.
</p>]]></description>
      <pubDate>Mon, 07 Jan 2008 08:41:00 -0600</pubDate>
    </item>
    <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>
    <item>
      <title><![CDATA[Ben Ramsey's Blog: Flickr Namespace and array_multisort() Issues]]></title>
      <guid>http://www.phpdeveloper.org/news/6916</guid>
      <link>http://www.phpdeveloper.org/news/6916</link>
      <description><![CDATA[<p>
<i>Ben Ramsey</i> has posted a (quick) <a href="http://benramsey.com/archives/flickr-namespace-and-array_multisort-issues/">new items</a> over on his blog that looks at solving two problems he was having with his blog - the now non-functional Flickr feed and a sorting problem with array_multisort.
</p>
<blockquote>
I recently upgraded a few things around here (in particular, an upgrade to PHP 5.2), and I noticed two issues that occurred after the upgrade. [...] I easily solved both of these issues.
</blockquote>
<p>
The correction to the Flickr feed involved changing the namespace information for his request (adding a trailing slash) because the SimpleXML functionality got a bit more particular about the format.
</p>
<p>
The problem with array_multisort involved adding in a parameter that was implied in previous PHP versions, SORT_STRING, to get his code correctly working.
</p>]]></description>
      <pubDate>Mon, 18 Dec 2006 11:33:00 -0600</pubDate>
    </item>
  </channel>
</rss>
