<?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>Thu, 23 May 2013 03:01:43 -0500</pubDate>
    <ttl>30</ttl>
    <item>
      <title><![CDATA[DevShed: Collections and Sorting Continued]]></title>
      <guid>http://www.phpdeveloper.org/news/5108</guid>
      <link>http://www.phpdeveloper.org/news/5108</link>
      <description><![CDATA[Previously <a href="http://www.phpdeveloper.org/news/5067">from DevShed</a>, they started a series on collections and sorting in PHP. Today, they've posted <a href="http://www.devshed.com/c/a/PHP/Collections-and-Sorting-Continued/">part two</a> of the series that builds on that and looks at sorting algorithm examples.
<p>
<quote>
<i>
This article will examine the primary sorting algorithms with code examples, and some empirical data regarding how they perform in relation to one another, as well as the size of the data set in question.
<p>
We will also create a function to fill up our collection with random data in order to test the sort algorithms with a sufficiently large data set. The sort algorithms listed above are the ones that every computer science student learns in college and are the primary sort algorithms found in real-world applications.
</i>
</quote>
<p>
The sorting styles <a href="http://www.devshed.com/c/a/PHP/Collections-and-Sorting-Continued/">they cover</a> include: bubble sort, heap sort, merge sort, quick sort, and shell sort. For each, they provide the code, making it a simple matter of cut and paste to make it work in your script. There's not a whole lot of documentation going along with the code in this article, but the sorting code is simple enough to understand without it.]]></description>
      <pubDate>Wed, 05 Apr 2006 07:13:17 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[DevShed: Collections and Sorting]]></title>
      <guid>http://www.phpdeveloper.org/news/5067</guid>
      <link>http://www.phpdeveloper.org/news/5067</link>
      <description><![CDATA[There are features in every language that developers love to have - in PHP, there are some impressive string and array handling functions that some developers would like to carry over. Unfortunately, there are also some bits of functionality that haven't quite made it to PHP yet - namely collections. In other languages, such as Java or C#, these handy containers let you hold objects for use later. PHP lacks this kind of functionality inherently, but <a href="http://www.devshed.com/c/a/PHP/Collections-and-Sorting/">this new DevShed article</a> might just have a way around it.
<p>
<quote>
<i>
A collection is an object whose primary function is to store a number of like objects. An object called CarCollection may contain any number of Car objects. Collections can traditionally be accessed in the same manner as arrays, which means CarCollection[n] represents a particular Car object. This is true in C#, Java, and more - but not PHP, unfortunately. Since PHP has only recently begun to develop a package of built in objects (the SPL, Standard PHP Library), the ability to support collections in the accepted behavioral sense is very limited.
</i>
</quote>
<p>
Their <a href="http://www.devshed.com/c/a/PHP/Collections-and-Sorting/">mission</a> is to work with a datatype that PHP does have to simulate this kind of collection handling - arrays. They walk you through the creation of a foundation class, one that simply allows you to get and fetch from the array. Extending that makes it possible to create a customized method for sorting  personal data (name). ]]></description>
      <pubDate>Wed, 29 Mar 2006 07:58:03 -0600</pubDate>
    </item>
  </channel>
</rss>
