How to extract data out of a specific PHP array

Posted by user77413 on Stack Overflow See other posts from Stack Overflow or by user77413
Published on 2011-02-07T23:18:12Z Indexed on 2011/02/07 23:25 UTC
Read the original article Hit count: 153

Filed under:

I have a multi-dimensional array that looks like this: The base array is indexed based on category ids from my catalog.

$categories[category_id]

Each base array has two underlying elements:

['parent_category_id']
['sort_order']

I want to create a function that allows us to create a list of categories 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.

© Stack Overflow or respective owner

Related posts about php