[![enter image description here](https://i.stack.imgur.com/FU62X.jpg)](https://i.stack.imgur.com/FU62X.jpg)

Apologies to all those who might feel offended or pissed by my question we all learn everyday.
I want to be able to generate a table that will look like what i have in this picture from this two different arrays also shown on the table.

I can generate a normal table with a foreach loop but in this case it becoming confusing and i have not been able to try anything tangible. So any help will be appreciated .

example raw array

```
$data1 = array(
     '0' => array('time'=> '1.00pm', 'reading' =>'271', 'machine'=>'machine1'),
     '1' => array('time'=> '2.00pm', 'reading' =>'261', 'machine'=>'machine1'),
     '2' => array('time'=> '3.00pm', 'reading' =>'172', 'machine'=>'machine1'),
     '3' => array('time'=> '4.00pm', 'reading' =>'300', 'machine'=>'machine1'),
     '4' => array('time'=> '5.00pm', 'reading' =>'142', 'machine'=>'machine1')
    );
$data2 = array(
     '0' => array('time'=> '1.00pm', 'reading' =>'500', 'machine'=>'machine2'),
     '1' => array('time'=> '2.00pm', 'reading' =>'432', 'machine'=>'machine2'),
     '2' => array('time'=> '3.00pm', 'reading' =>'109', 'machine'=>'machine2'),
     '3' => array('time'=> '4.00pm', 'reading' =>'44', 'machine'=>'machine2'),
     '4' => array('time'=> '5.00pm', 'reading' =>'18', 'machine'=>'machine2')
    );

```

so any help will be appreciated