I have the following output created from a PHP script I have created:
Array
(
[cage] => OK
[logicaldrive] => Array
(
[logicaldrive 1] => Array
(
[size] => 2.7 TB
[raid] => RAID 1
[status] => OK
)
)
[physicaldrive] => Array
(
[logicaldrive 1] => Array
(
[physicaldrive 2I:1:1] => Array
(
[bay] => port 2I:box 1:bay 1
[type] => SATA
[size] => 3 TB
[status] => OK
)
[physicaldrive 2I:1:2] => Array
(
[bay] => port 2I:box 1:bay 2
[type] => SATA
[size] => 3 TB
[status] => OK
)
)
)
I would like to be able to format this data into a table, I have tried but unable to run a foreach loop on sections of the array, for example if I want a table to have the information from:
[logicaldrive] => Array
(
[logicaldrive 1] => Array
(
[size] => 2.7 TB
[raid] => RAID 1
[status] => OK
)
)
I can't work out how to get the values of size, raid, status without knowing the key (logicaldrive 1) which depending on the system that the code has run on will be different each time.