Jump to content

Multli Dimensional Arrays.......


ealonw

Recommended Posts

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.