ealonw Posted May 4, 2010 Share Posted May 4, 2010 Is anyone able to show how to merge arrays or to rid duplicates of variable types in an array? i have a singe array: $data_dump= array( 'CONSUMABLE'=>$data['CONSUMABLE'], 'SUBDEPARTMENT'=>$data['SUBDEPARTMENT'], 'STUDENTSCNT'=>$data['STUDENTSCNT'])); When I var_dump I get this: array(3) { ["CONSUMABLE"]=> string(5) "PAPER" ["SUBDEPARTMENT"]=> string(2) "LA" ["STUDENTSCNT"]=> int(13) } array(3) { ["CONSUMABLE"]=> string(5) "PAPER" ["SUBDEPARTMENT"]=> string(2) "OC" ["STUDENTSCNT"]=> int(5) } array(3) { ["CONSUMABLE"]=> string(5) "PENS" ["SUBDEPARTMENT"]=> string(2) "SD" ["STUDENTSCNT"]=> int(2) } What i want to show is this: paper-LA-13-OC-5; pens-SD-2; Link to comment https://forums.phpfreaks.com/topic/200729-multli-dimensional-arrays/ Share on other sites More sharing options...
teamatomic Posted May 4, 2010 Share Posted May 4, 2010 array_merge, array_unique HTH Teamatomic Link to comment https://forums.phpfreaks.com/topic/200729-multli-dimensional-arrays/#findComment-1053324 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.