I have a PHP shell_exec command that outputs the following:
Cats
3
Dogs
9
Fish
2
Every second line is a number, that corresponds to the name of the animal on previous line, i would like the output in a HTML table for example:
HTML TABLE
------------
| Cats | 3 |
| Dogs | 9 |
| Fish | 2 |
------------
I think i need to create an array, but i am not sure how to align the animal name and number onto the same line. At the moment i have this:
<?php
$array1 = array();
exec( "Command", $Output );
?>
<html>
<table>
<tr>
<th>Animal</th>
<th>Number</th>
</tr>
<tr>
<td>*</td>
<td>*</td>
</tr>
<tr>
<td>*</td>
<td>*</td>
</tr>
<tr>
<td>*</td>
<td>*</td>
</tr>
</tr>
</table>
</body>
</html>
How can i put this into a HTML Table?