fork(3) download
  1. <?php
  2.  
  3. $arr = array("Apple","orange","strawberry");
  4. $abc = '<table border="2">
  5. <tr>
  6. <th>Names</th>
  7. </tr>';
  8. foreach($arr as $key){
  9. $abc.='<tr>
  10. <td>'.$key.'</td>
  11. </tr>';
  12. }
  13. $abc.='</table>';
  14.  
  15. echo $abc;
Success #stdin #stdout 0.02s 82880KB
stdin
Standard input is empty
stdout
<table border="2">
            <tr>
                <th>Names</th>
            </tr><tr>
                <td>Apple</td>
            </tr><tr>
                <td>orange</td>
            </tr><tr>
                <td>strawberry</td>
            </tr></table>