I have been struggling with this nested array all night, so I finally decided to ask for some help on this. I am trying to correct this nested array I have below into something else. Please respond with code examples/solutions. I am not the best PHP programmer. Thank you all in advance!
What I want it to look like:
array
0 =>
'enginename' => string 'Engine1' (length=19)
'status' => string 'up' (length=2)
'time' => string '2013-04-17 09:28:00' (length=19)
1 =>
'enginename' => string 'Engine2' (length=19)
'status' => string 'up' (length=2)
'time' => string '2013-04-17 09:28:00' (length=19)
What it currently looks like:
Writing data...
The total # of columns in this query are: 3
The length of the first array is: 363
array
0 =>
array
0 =>
array
'enginename' => string 'Engine1' (length=19)
1 =>
array
'status' => string 'up' (length=2)
2 =>
array
'time' => string '2013-04-17 09:28:00' (length=19)
1 =>
array
3 =>
array
'enginename' => string 'Engine2' (length=20)
4 =>
array
'status' => string 'up' (length=2)
5 =>
array
'time' => string '2013-04-17 09:28:00' (length=19)
2 =>
array
6 =>
array
'enginename' => string 'Engine3' (length=30)
7 =>
array
'status' => string 'up' (length=2)
8 =>
array
'time' => string '2013-04-17 09:28:00' (length=19)
Update 4/24 10:26am:: bwoebi's Example Output This is good thank you, but not 100% what I need. it removed the nested arrays but also separated all the keys again. I need the first 3 keys in one "group" like my original example shows.
array
0 =>
array
'enginename' => string 'Engine1' (length=19)
1 =>
array
'status' => string 'up' (length=2)
2 =>
array
'time' => string '2013-04-17 09:28:00' (length=19)
3 =>
array
'enginename' => string 'Engine2' (length=20)
4 =>
array
'status' => string 'up' (length=2)
5 =>
array
'time' => string '2013-04-17 09:28:00' (length=19)
6 =>
array
'enginename' => string 'Engine3' (length=30)
7 =>
array
'status' => string 'up' (length=2)
8 =>
array
'time' => string '2013-04-17 09:28:00' (length=19)
Update 4/24 10:36am:: bwoebi's Corrected Example Output
array
0 =>
array
'enginename' => string 'Engine1' (length=19)
'status' => string 'up' (length=2)
'time' => string '2013-04-17 09:28:00' (length=19)
1 =>
array
'enginename' => string 'Engine2' (length=20)
'status' => string 'up' (length=2)
'time' => string '2013-04-17 09:28:00' (length=19)
2 =>
array
'enginename' => string 'Engine3' (length=30)
'status' => string 'up' (length=2)
'time' => string '2013-04-17 09:28:00' (length=19)