I have
foreach($devices as $value) {
echo '<pre>';print_r($value);echo '</pre>';
}
which produces a huge array
Array
(
[Name] => Dog Locator
[Device_Id] => 5
[Room] => Comms Room
[Link] => ../rooms/comms.php
[Rack_Title] => Racky
[Rack_Id] => 1
[Row] => 1
[Bay] => A
)
Array
(
[Name] => Dog Locator
[Device_Id] => 7
[Room] => Comms Room
[Link] => ../rooms/comms.php
[Rack_Title] => Racky
[Rack_Id] => 1
[Row] => 1
[Bay] => A
)
Array
(
[Name] => Dog Locator
[Device_Id] => 9
[Room] => Comms Room
[Link] => ../rooms/comms.php
[Rack_Title] => Racky
[Rack_Id] => 1
[Row] => 1
[Bay] => A
)
...
Im trying to break up that array into 6 arrays.
The 6 arrays should be grouped by the Room index of the big array
I thought something like this would work
foreach($devices as $key => $value) {
if($value['Room'] = 'Comms Room') {
$deviocesInCommsRoom[] .= $key[$value];
}
print_r($deviocesInCommsRoom);