<?php
$products = array(
'CATEGORY' =>
array(
'book' =>
array(
0 =>
array(
'DESCRIPTION' => 'Bar',
),
1 =>
array(
'DESCRIPTION' => 'sdfadasfdasfas',
),
),
'desk' =>
array(
0 =>
array(
'DESCRIPTION' => 'Barrrr',
),
),
),
);
$cat_to_index = '';
foreach (array_values(array_unique($products['CATEGORY'])) as $category => $uniq_cat) {
for($i=array_search($uniq_cat, $products['CATEGORY']);
$i!==FALSE; $i=array_search($uniq_cat, $products['CATEGORY']))
$cat_to_index .= $i; // just for debugging
}
?>