I have this array:
$result = array(
'0' => array(
'field_categories' => 'Visitor',
'field_name' => 'Visitor-1',
),
'1' => array(
'field_categories' => 'Visitor',
'field_name' => 'Visitor-2'
),
'2' => array(
'field_categories' => 'Visitor',
'field_name' => 'Visitor-3'
),
'3' => array(
'field_categories' => 'Visitor',
'field_name' => 'Visitor-4'
),
'4' => array(
'field_categories' => 'Doctor',
'field_name' => 'Doctor-1'
),
'5' => array(
'field_categories' => 'Doctor',
'field_name' => 'Doctor-2'
),
'6' => array(
'field_categories' => 'Manager',
'field_name' => 'Manager-1'
),
'7' => array(
'field_categories' => 'Manager',
'field_name' => 'Manager-2'
),
'8' => array(
'field_categories' => 'Manager',
'field_name' => 'Manager-3'
)
);
echo '<pre>',print_r($result),'</pre>';
And how can I convert it to this format?
(output of echo '<pre>',print_r($result),'</pre>';
) Thanks
Array
(
[0] => Visitor
[1] => Visitor-1
[2] => Visitor-2
[3] => Visitor-3
[4] => Visitor-4
[5] => Doctor
[6] => Doctor-1
[7] => Doctor-2
[8] => Manager
[9] => Manager-1
[10] => Manager-2
[11] => Manager-3
)