How to extract data out of a specific PHP array
<p>I have a multi-dimensional array that looks like this: 
The base array is indexed based on category ids from my catalog.  </p>

<pre><code>$cat[category_id]
</code></pre>

<p>Each base array has three underlying elements: </p>

<pre><code>['parent_id']
['sort_order']
['name']
</code></pre>

<p>I want to create a function that allows us to create a list of category_id's and names for a given parent_category_id in the correct sort order.  Is this possible?  Technically it is the same information, but the array is constructed in a weird way to extract that information.  </p>

<p>Here is an example definition for the array:</p>

<pre><code>$cat = array();
$cat[32]['parent_id']= 0;
$cat[32]['sort_order']= 1;
$cat[32]['name']= 'my-category-name1';
$cat[45]['parent_id']= 0;
$cat[45]['sort_order']= 0;
$cat[45]['name']= 'my-category-name2';
$cat[2]['parent_id']= 0;
$cat[2]['sort_order']= 2;
$cat[2]['name'] = "my-category-name3";
$cat[3]['parent_id']= 2;
$cat[3]['sort_order']= 1;
$cat[3]['name'] = "my-category-name4";
$cat[6]['parent_id']= 2;
$cat[6]['sort_order']= 0;
$cat[6]['name'] = "my-category-name5";
</code></pre>
