I have a multi-dimensional array that looks like this:
Array
(
[Category-1-Name] => Array // Category-array
(
[0] => Array // Post-array
(
[0] => Post-0-name
[1] => Post-0-url
[2] => Post-0-text
)
[1] => Array
(
[0] => Post-1-name
[1] => Post-1-url
[2] => Post-1-text
)
)
[Category-2-Name] => Array
(
[0] => Array
(
[0] => Post-0-name
[1] => Post-0-url
[2] => Post-0-text
)
[1] => Array
(
[0] => Post-1-name
[1] => Post-1-url
[2] => Post-1-text
)
)
)
I fill the array like this:
$q = array();
$a = array("Post-0-name", "Post-0-url", "Post-0-text");
foreach ( $categories as $key=>$category ) {
$b = $category->name;
}
$q[$b][] = $a;
I would like to add one more dimension: Category description for each category.
Is it posibble to do this without repeating the description in every Post-array?